Skip to content

Commit

Permalink
Allow users to pass in a custom linting configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kendallgassner committed Jan 8, 2025
1 parent bd419f1 commit 1a2ce92
Show file tree
Hide file tree
Showing 117 changed files with 17,077 additions and 4,274 deletions.
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

0 comments on commit 1a2ce92

Please sign in to comment.