Skip to content

Commit 4bad9f6

Browse files
committed
feat: Initial release
1 parent 7728654 commit 4bad9f6

File tree

13 files changed

+380
-1
lines changed

13 files changed

+380
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release GitHub Actions
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the release"
8+
required: true
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
release:
15+
permissions:
16+
actions: read
17+
id-token: write
18+
contents: write
19+
20+
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
21+
with:
22+
tag: "${{ github.event.inputs.tag }}"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: NPM Audit Fix Run
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
force:
7+
description: "Use --force flag for npm audit fix?"
8+
required: true
9+
type: boolean
10+
base_branch:
11+
description: "Specify a base branch"
12+
required: false
13+
default: "main"
14+
schedule:
15+
- cron: "0 0 * * 1"
16+
17+
jobs:
18+
audit-fix:
19+
uses: step-security/reusable-workflows/.github/workflows/audit_fix.yml@v1
20+
with:
21+
force: ${{ inputs.force || false }}
22+
base_branch: ${{ inputs.base_branch || 'main' }}
23+
24+
permissions:
25+
contents: write
26+
pull-requests: write
27+
packages: read
28+
issues: write

.github/workflows/depup.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: depup
2+
on:
3+
schedule:
4+
- cron: '14 14 * * *' # Runs at 14:14 UTC every day
5+
repository_dispatch:
6+
types: [depup]
7+
workflow_dispatch:
8+
9+
jobs:
10+
markdownlint-cli:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
- uses: haya14busa/action-depup@94a1aaf4e4923064019214b48a43276218af7ad5 # v1.6.4
15+
id: depup
16+
with:
17+
file: Dockerfile
18+
version_name: MARKDOWNLINT_CLI_VERSION
19+
repo: igorshubovych/markdownlint-cli
20+
21+
- name: Create Pull Request
22+
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
title: "chore(deps): update markdownlint-cli to ${{ steps.depup.outputs.latest }}"
26+
commit-message: "chore(deps): update markdownlint-cli to ${{ steps.depup.outputs.latest }}"
27+
body: |
28+
Update markdownlint-cli to [v${{ steps.depup.outputs.latest }}](https://github.com/igorshubovych/markdownlint-cli/tag/v${{ steps.depup.outputs.latest }})
29+
Compare [v${{ steps.depup.outputs.current }}...v${{ steps.depup.outputs.latest }}](https://github.com/igorshubovych/markdownlint-cli/compare/v${{ steps.depup.outputs.current }}...v${{ steps.depup.outputs.latest }})
30+
31+
This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3Adepup).
32+
branch: depup/markdownlint-cli
33+
base: main
34+
labels: "bump:minor"
35+
36+
reviewdog:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
- uses: haya14busa/action-depup@94a1aaf4e4923064019214b48a43276218af7ad5 # v1.6.4
41+
id: depup
42+
with:
43+
file: Dockerfile
44+
version_name: REVIEWDOG_VERSION
45+
repo: reviewdog/reviewdog
46+
47+
- name: Create Pull Request
48+
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
49+
with:
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
title: "chore(deps): update reviewdog to ${{ steps.depup.outputs.latest }}"
52+
commit-message: "chore(deps): update reviewdog to ${{ steps.depup.outputs.latest }}"
53+
body: |
54+
Update reviewdog to [v${{ steps.depup.outputs.latest }}](https://github.com/reviewdog/reviewdog/releases/tag/v${{ steps.depup.outputs.latest }})
55+
Compare [v${{ steps.depup.outputs.current }}...v${{ steps.depup.outputs.latest }}](https://github.com/reviewdog/reviewdog/compare/v${{ steps.depup.outputs.current }}...v${{ steps.depup.outputs.latest }})
56+
57+
This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3Adepup).
58+
branch: depup/reviewdog
59+
base: main
60+
labels: "bump:minor"

.github/workflows/dockerimage.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Docker Image CI
2+
3+
on: [push]
4+
5+
jobs:
6+
7+
build:
8+
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13+
- name: Build the Docker image
14+
run: docker build --file Dockerfile --tag action-markdownlint:$(date +%s) .

.github/workflows/guarddog.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Run GuardDog Scan on PRs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
call-guarddog-scan:
14+
uses: step-security/reusable-workflows/.github/workflows/guarddog.yml@v1

.github/workflows/reviewdog.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: reviewdog
2+
on: [pull_request]
3+
jobs:
4+
markdownlint:
5+
name: runner / markdownlint
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9+
- name: markdownlint-github-check
10+
uses: ./
11+
with:
12+
github_token: ${{ secrets.GITHUB_TOKEN }}
13+
reporter: github-check
14+
level: warning
15+
filter_mode: nofilter
16+
17+
- name: markdownlint-github-pr-review
18+
uses: ./
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
reporter: github-pr-review

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:20-bullseye-slim
2+
3+
ENV MARKDOWNLINT_CLI_VERSION=v0.41.0
4+
5+
RUN npm install -g "markdownlint-cli@$MARKDOWNLINT_CLI_VERSION"
6+
7+
ENV REVIEWDOG_VERSION=v0.20.2
8+
9+
RUN apt-get update \
10+
&& apt-get install -y --no-install-recommends \
11+
ca-certificates \
12+
git \
13+
wget \
14+
&& apt-get clean \
15+
&& rm -rf /var/lib/apt/lists/*
16+
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/fd59714416d6d9a1c0692d872e38e7f8448df4fc/install.sh \
17+
| sh -s -- -b /usr/local/bin/ ${REVIEWDOG_VERSION}
18+
19+
COPY entrypoint.sh /entrypoint.sh
20+
21+
ENTRYPOINT ["/entrypoint.sh"]
22+
CMD []

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 James Mills / prologic
4+
Copyright (c) 2025 StepSecurity
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,74 @@
1-
# action-markdownlint
1+
# GitHub Action: Run markdownlint with reviewdog
2+
3+
Based on [reviewdog/action-shellcheck](https://github.com/reviewdog/action-shellcheck)
4+
5+
[![Docker Image CI](https://github.com/prologic/action-markdownlint/workflows/Docker%20Image%20CI/badge.svg)](https://github.com/prologic/action-markdownlint/actions)
6+
[![Release](https://img.shields.io/github/release/prologic/action-markdownlint.svg?maxAge=43200)](https://github.com/prologic/action-markdownlint/releases)
7+
8+
This action runs [markdownlint](https://github.com/DavidAnson/markdownlint) with
9+
[reviewdog](https://github.com/reviewdog/reviewdog) on pull requests to improve
10+
code review experience.
11+
12+
## Inputs
13+
14+
<!-- markdownlint-disable MD013 -->
15+
```yml
16+
inputs:
17+
github_token:
18+
description: 'GITHUB_TOKEN.'
19+
default: '${{ github.token }}'
20+
### Flags for reviewdog ###
21+
level:
22+
description: 'Report level for reviewdog [info,warning,error]'
23+
default: 'error'
24+
reporter:
25+
description: 'Reporter of reviewdog command [github-check,github-pr-review].'
26+
default: 'github-check'
27+
filter_mode:
28+
description: |
29+
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
30+
Default is added.
31+
default: 'added'
32+
fail_level:
33+
description: |
34+
If set to `none`, always use exit code 0 for reviewdog.
35+
Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level.
36+
Possible values: [none,any,info,warning,error]
37+
Default is `none`.
38+
default: 'none'
39+
fail_on_error:
40+
description: |
41+
Deprecated, use `fail_level` instead.
42+
Exit code for reviewdog when errors are found [true,false]
43+
Default is `false`.
44+
deprecationMessage: Deprecated, use `fail_level` instead.
45+
default: 'false'
46+
reviewdog_flags:
47+
description: 'Additional reviewdog flags'
48+
default: ''
49+
### Flags for markdownlint-cli ###
50+
markdownlint_flags:
51+
description: "Options of markdownlint-cli command. Default: '.'"
52+
default: '.'
53+
```
54+
<!-- markdownlint-enable MD013 -->
55+
56+
## Example usage
57+
58+
### [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml)
59+
60+
```yml
61+
name: reviewdog
62+
on: [pull_request]
63+
jobs:
64+
markdownlint:
65+
name: runner / markdownlint
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
69+
- name: markdownlint
70+
uses: step-security/action-markdownlint@3667398db9118d7e78f7a63d10e26ce454ba5f58 # v0.26.2
71+
with:
72+
github_token: ${{ secrets.GITHUB_TOKEN }}
73+
reporter: github-pr-review
74+
```

SECURITY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
Please report security vulnerabilities to [email protected]

0 commit comments

Comments
 (0)