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

chore(ci): check GitHub Action workflow files via actionlint #1175

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 2 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ jobs:
run: .github/workflows/calculate-alpha-release.bash

- name: Publish on crates.io
uses: actions-rs/cargo@v1
with:
command: publish
args: --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
run: cargo publish --allow-dirty --token ${{ secrets.CARGO_TOKEN }}

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
Expand All @@ -60,7 +57,4 @@ jobs:
uses: actions/checkout@v4

- name: Publish on crates.io
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CARGO_TOKEN }}
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ jobs:
pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!:'
# Check if pattern matches
if echo "${PR_TITLE}" | grep -qE "$pattern"; then
echo "breaking_change=true" >> $GITHUB_OUTPUT
echo "breaking_change=true" >> "$GITHUB_OUTPUT"
else
echo "breaking_change=false" >> $GITHUB_OUTPUT
echo "breaking_change=false" >> "$GITHUB_OUTPUT"
fi
- name: Add label
if: steps.check_breaking_change.outputs.breaking_change == 'true'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ jobs:
uses: crate-ci/typos@master
- name: Lint dependencies
uses: EmbarkStudios/cargo-deny-action@v1
- name: Check workflow files
uses: docker://rhysd/actionlint:latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure its really useful to keep this always running. CI is changing not that often. A link to the online check tool might be more relevant.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine, it's not much of a resource heavy thing anyways.

Copy link
Member

@joshka joshka Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps gate it on the path - not sure I like the docker approach to running something like this as this becomes a barrier to security auditing.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other ways of using this as well: https://github.com/rhysd/actionlint/blob/main/docs/usage.md

The docker approach looked safer than yolo-downloading a script and running it so I went with that

with:
args: -color

clippy:
runs-on: ubuntu-latest
Expand Down