Skip to content

Commit fe35b86

Browse files
kojiromikeclaude
andauthored
chore(ci): implement actionlint for GitHub Actions workflows (#13)
Add actionlint to validate workflow files: - Add actionlint pre-commit hook (v1.7.10) - Add actionlint CI workflow - Fix existing issues in build-phar.yml: - Quote $GITHUB_OUTPUT (shellcheck SC2086) - Update actions/cache v3 → v4 - Update softprops/action-gh-release v1 → v2 Fixes #11 Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent 288ae55 commit fe35b86

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

.github/workflows/actionlint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: actionlint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
actionlint:
13+
name: Lint GitHub Actions workflows
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Run actionlint
21+
uses: rhysd/[email protected]

.github/workflows/build-phar.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030

3131
- name: Get Composer cache directory
3232
id: composer-cache
33-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
33+
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
3434

3535
- name: Cache Composer dependencies
36-
uses: actions/cache@v3
36+
uses: actions/cache@v4
3737
with:
3838
path: ${{ steps.composer-cache.outputs.dir }}
3939
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -58,7 +58,7 @@ jobs:
5858
5959
- name: Upload PHAR to release
6060
if: github.event_name == 'release'
61-
uses: softprops/action-gh-release@v1
61+
uses: softprops/action-gh-release@v2
6262
with:
6363
files: |
6464
build/oce-import-codes.phar

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ repos:
3232
- --indent=2
3333
exclude: ^compose\.yml$ # Uses Docker Compose !override tags
3434

35+
- repo: https://github.com/rhysd/actionlint
36+
rev: v1.7.10
37+
hooks:
38+
- id: actionlint
39+
3540
- repo: local
3641
hooks:
3742
- id: php-syntax-check

0 commit comments

Comments
 (0)