Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to pass in a custom linting configuration #61

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ This makes sure you stay on a stable version of this action.

Replace the ref value with any commit hash.

### Adding a custom linting configuration

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.

```yml
steps:
- name: Check alt text #change this step to use the
uses: github/[email protected]
with:
config: |
no-default-alt-text: true,
no-alt-text: true,
no-empty-alt-text: true,
no-generic-link-text: true,
```

## License

This project is licensed under the terms of the MIT open source license.
Expand Down
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ runs:
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')
fi
fi
flag=$(node ${{ github.action_path }}/src/index.js "$content")
flag=$(node ${{ github.action_path }}/src/index.js "$content" "$CONFIG")
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:

$flag
Expand Down Expand Up @@ -115,3 +115,4 @@ runs:
ISSUE_BODY: ${{ github.event.issue.body }}
PR_BODY: ${{ github.event.pull_request.body }}
DISCUSSION_BODY: ${{ github.event.discussion.body }}
CONFIG: ${{ inputs.config }}
55 changes: 36 additions & 19 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading