Skip to content

Commit

Permalink
Adding actionlint and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dmorgan-fa committed Jul 10, 2024
1 parent 59e0569 commit 688fa7d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint workflow files

on:
pull_request:
paths:
- '.github/workflows/*.yml'
- '.github/workflows/*.yaml'

permissions:
pull-requests: write
contents: read

jobs:
actionlint:
uses: fac/hermod/.github/workflows/actionlint.yml@master
secrets: inherit
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
brew 'actionlint'
brew 'lefthook'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ config.all_sso_sessions
## Making a commit
[Lefthook](https://github.com/evilmartians/lefthook/) has [been configured](./lefthook.yml) with pre-commit checks to:
- run `rubocop` for any `ruby` files
- run `actionlint` for any GitHub workflow files

If for some reason it's necessary, it's possible to temporarily skip `lefthook` with: `LEFTHOOK=0 git commit`.

Expand Down
3 changes: 3 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
pre-commit:
parallel: true
commands:
actionlint:
glob: ".github/workflows/*.{yml,yaml}"
run: actionlint {staged_files}
ruby-lint:
glob: "*.rb"
run: bundle exec rubocop {staged_files}

0 comments on commit 688fa7d

Please sign in to comment.