Skip to content

Commit 1a2ce92

Browse files
Allow users to pass in a custom linting configuration
1 parent bd419f1 commit 1a2ce92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+17077
-4274
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ This makes sure you stay on a stable version of this action.
6767
6868
Replace the ref value with any commit hash.
6969
70+
### Adding a custom linting configuration
71+
72+
If you would like to include more linting rules from the [markdownlint](https://github.com/DavidAnson/markdownlint) or [markdownlint-github](https://github.com/github/markdownlint-github) rulesets pass a config object to the `github/accessibility-alt-text-bot` action.
73+
74+
```yml
75+
steps:
76+
- name: Check alt text #change this step to use the
77+
uses: github/[email protected]
78+
with:
79+
config: |
80+
no-default-alt-text: true,
81+
no-alt-text: true,
82+
no-empty-alt-text: true,
83+
no-generic-link-text: true,
84+
```
85+
7086
## License
7187

7288
This project is licensed under the terms of the MIT open source license.

action.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ runs:
6161
bot_comment_id=$(gh api repos/${{ github.repository }}/discussions/${{ github.event.discussion.number }}/comments | jq -r '.[] | select(.user.login == "github-actions[bot]") | select(.body | test("<div alt-text-bot-id=\"${{ github.event.discussion.id }}\"")) | .node_id')
6262
fi
6363
fi
64-
flag=$(node ${{ github.action_path }}/src/index.js "$content")
64+
flag=$(node ${{ github.action_path }}/src/index.js "$content" "$CONFIG")
6565
message="<div alt-text-bot-id=\"$target_id\" /> Uh oh! @$user, at least one image you shared is missing helpful alt text. Check $target to fix the following violations:
6666
6767
$flag
@@ -115,3 +115,4 @@ runs:
115115
ISSUE_BODY: ${{ github.event.issue.body }}
116116
PR_BODY: ${{ github.event.pull_request.body }}
117117
DISCUSSION_BODY: ${{ github.event.discussion.body }}
118+
CONFIG: ${{ inputs.config }}

node_modules/.package-lock.json

+36-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@istanbuljs/load-nyc-config/node_modules/.bin/js-yaml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@istanbuljs/load-nyc-config/node_modules/argparse/CHANGELOG.md

+185
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@istanbuljs/load-nyc-config/node_modules/argparse/LICENSE

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)