Skip to content

Commit b19cf6d

Browse files
authored
ci: add actionlint workflow (#3503)
Adds an `actionlint` job that runs on changes to `.github/workflows/**` and `.github/actions/**`. Catches workflow bugs at PR time — expression typos, deprecated runner labels, broken matrices, and shellcheck issues in `run:` blocks. Run from the official `docker://rhysd/actionlint` image, digest-pinned alongside everything else. Existing workflows had 6 shellcheck findings, all fixed.
1 parent 57cca97 commit b19cf6d

7 files changed

Lines changed: 55 additions & 18 deletions

File tree

.github/workflows/actionlint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Actionlint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- '.github/workflows/**'
8+
- '.github/actions/**'
9+
pull_request:
10+
paths:
11+
- '.github/workflows/**'
12+
- '.github/actions/**'
13+
14+
permissions: {}
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
actionlint:
22+
name: Actionlint
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
persist-credentials: false
31+
32+
- name: Run actionlint
33+
uses: docker://rhysd/actionlint:1.7.12@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667

.github/workflows/helm-prerelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
fi
119119
PRERELEASE_VERSION="${BASE_VERSION}-${REF_SLUG}.${SHORT_SHA}"
120120
fi
121-
echo "version=$PRERELEASE_VERSION" >> $GITHUB_OUTPUT
121+
echo "version=$PRERELEASE_VERSION" >> "$GITHUB_OUTPUT"
122122
echo "Prerelease version: $PRERELEASE_VERSION"
123123
124124
- name: Update Chart.yaml with prerelease version

.github/workflows/publish-webapp.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ jobs:
5959
- name: 📝 Set the build info
6060
id: set_build_info
6161
run: |
62-
tag=${{ steps.get_tag.outputs.tag }}
63-
if [[ "${{ steps.get_tag.outputs.is_semver }}" == true ]]; then
64-
echo "BUILD_APP_VERSION=${tag}" >> "$GITHUB_OUTPUT"
65-
fi
66-
echo "BUILD_GIT_SHA=${{ github.sha }}" >> "$GITHUB_OUTPUT"
67-
echo "BUILD_GIT_REF_NAME=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
68-
echo "BUILD_TIMESTAMP_SECONDS=$(date +%s)" >> "$GITHUB_OUTPUT"
62+
{
63+
tag="${{ steps.get_tag.outputs.tag }}"
64+
if [[ "${{ steps.get_tag.outputs.is_semver }}" == true ]]; then
65+
echo "BUILD_APP_VERSION=${tag}"
66+
fi
67+
echo "BUILD_GIT_SHA=${{ github.sha }}"
68+
echo "BUILD_GIT_REF_NAME=${{ github.ref_name }}"
69+
echo "BUILD_TIMESTAMP_SECONDS=$(date +%s)"
70+
} >> "$GITHUB_OUTPUT"
6971
7072
- name: 🐙 Login to GitHub Container Registry
7173
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0

.github/workflows/publish-worker-v4.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ jobs:
4444

4545
- name: 📦 Get image repo
4646
id: get_repository
47+
env:
48+
PACKAGE: ${{ matrix.package }}
4749
run: |
48-
if [[ "${{ matrix.package }}" == *-provider ]]; then
49-
provider_type=$(echo "${{ matrix.package }}" | cut -d- -f1)
50-
repo=provider/${provider_type}
50+
if [[ "$PACKAGE" == *-provider ]]; then
51+
repo="provider/${PACKAGE%-provider}"
5152
else
52-
repo="${{ matrix.package }}"
53+
repo="$PACKAGE"
5354
fi
5455
echo "repo=${repo}" >> "$GITHUB_OUTPUT"
5556

.github/workflows/publish-worker.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ jobs:
3232

3333
- name: 📦 Get image repo
3434
id: get_repository
35+
env:
36+
PACKAGE: ${{ matrix.package }}
3537
run: |
36-
if [[ "${{ matrix.package }}" == *-provider ]]; then
37-
provider_type=$(echo "${{ matrix.package }}" | cut -d- -f1)
38-
repo=provider/${provider_type}
38+
if [[ "$PACKAGE" == *-provider ]]; then
39+
repo="provider/${PACKAGE%-provider}"
3940
else
40-
repo="${{ matrix.package }}"
41+
repo="$PACKAGE"
4142
fi
4243
echo "repo=${repo}" >> "$GITHUB_OUTPUT"
4344

.github/workflows/release-helm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
VERSION="${{ github.ref_name }}"
9999
VERSION="${VERSION#helm-v}"
100100
fi
101-
echo "version=$VERSION" >> $GITHUB_OUTPUT
101+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
102102
echo "Releasing version: $VERSION"
103103
104104
- name: Check Chart.yaml version matches release version

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
env:
4444
PR_BODY: ${{ github.event.pull_request.body }}
4545
run: |
46-
echo "$PR_BODY" | sed -n '/^# Releases/,$p' >> $GITHUB_STEP_SUMMARY
46+
echo "$PR_BODY" | sed -n '/^# Releases/,$p' >> "$GITHUB_STEP_SUMMARY"
4747
4848
release:
4949
name: 🚀 Release npm packages

0 commit comments

Comments
 (0)