Skip to content

Commit

Permalink
add actionlint workflow (#772)
Browse files Browse the repository at this point in the history
close: #759
  • Loading branch information
Frank-III authored Feb 15, 2025
1 parent 1753130 commit 4c8164f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint GitHub Actions workflows

on:
push:
paths:
- ".github/workflows/*.ya?ml"
pull_request:
paths:
- ".github/workflows/*.ya?ml"

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/2ab3a12c7848f6c15faca9a92612ef4261d0e370/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
# - https://www.shellcheck.net/wiki/SC2016 - "Expressions don't expand in single quotes, use double quotes for that."
run: ${{ steps.get_actionlint.outputs.executable }} -color -ignore 'SC2016'
shell: bash
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ jobs:
- name: Tag the version
run: |
set -euxo pipefail
export CURRENT_VERSION="$(./scripts/get_current_version.sh trustfall-rustdoc-adapter)"
CURRENT_VERSION="$(./scripts/get_current_version.sh trustfall-rustdoc-adapter)"
export CURRENT_VERSION
git tag "v$CURRENT_VERSION"
git push origin "v$CURRENT_VERSION"
Expand All @@ -154,9 +155,9 @@ jobs:
export EXIT_CODE="$?"
set -e
if [[ "$EXIT_CODE" == "7" ]]; then
echo "is_new_version=no" >> $GITHUB_OUTPUT
echo "is_new_version=no" >> "$GITHUB_OUTPUT"
elif [[ "$EXIT_CODE" == "0" ]]; then
echo "is_new_version=yes" >> $GITHUB_OUTPUT
echo "is_new_version=yes" >> "$GITHUB_OUTPUT"
else
# Unexpected outcome, indicates a bug.
exit "$EXIT_CODE"
Expand Down

0 comments on commit 4c8164f

Please sign in to comment.