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

Simplify the workflows #6

Merged
merged 2 commits into from
Jul 10, 2024
Merged
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
Prev Previous commit
Adding actionlint and workflow
dmorgan-fa committed Jul 10, 2024
commit 688fa7d2a38ffc12afb04a28fa4aa364ce9c03a9
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
@@ -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`.

3 changes: 3 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -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}