Skip to content

Commit

Permalink
Provide example
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Dec 18, 2024
1 parent 31fbf16 commit b0f765a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/shell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
paths:
- "**.sh"
- ".github/workflows"
- ".github/workflows/*"
- "action.yaml"
- "gha_extract_shell_scripts.py"

Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

Processes the GitHub Action workflows contained within `.github/workflows` and extracts all steps which contain an embedded shell script for the purpose of running linting and formatting. Each workflow step containing a shell script will be written out to a file to make it easy to use existing tooling such as `shellcheck` and `shfmt`.

## Example

```yaml
---
name: Shell
on:
pull_request:
paths:
- "**.sh"
- ".github/workflows/*"

jobs:
lint-format:
name: Lint & Format
# These permissions are needed to:
# - Checkout the Git repo (`contents: read`)
# - Post a comments on PRs: https://github.com/luizm/action-sh-checker#secrets
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract workflow shell scripts
uses: beacon-biosignals/gha-extract-shell-scripts@31fbf16b19d1b371dc60be09c94df15bfb1b5fdf
- uses: luizm/action-sh-checker@c6edb3de93e904488b413636d96c6a56e3ad671a # v0.8.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
sh_checker_comment: true
```
## Inputs
The `gha-extract-shell-scripts` action supports the following inputs:
Expand Down

0 comments on commit b0f765a

Please sign in to comment.