From 3d543af2f196527f872c5dbe9f468d798c6e8712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8C=E1=85=A5=E1=86=BC=E1=84=8B=E1=85=B5=E1=86=AB?= =?UTF-8?q?=E1=84=80=E1=85=AF=E1=86=AB?= Date: Sat, 4 Apr 2026 22:41:09 +0900 Subject: [PATCH] chore(ci): validate action metadata conventions - add CI workflow to run actionlint - enforce node20 + dist/index.js conventions for all action.yml files - fix notify-on-failure package description and missing newline --- .github/workflows/action-metadata-lint.yml | 36 ++++++++++++++++++++++ notify-on-failure/action.yml | 2 +- notify-on-failure/package.json | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/action-metadata-lint.yml diff --git a/.github/workflows/action-metadata-lint.yml b/.github/workflows/action-metadata-lint.yml new file mode 100644 index 0000000..bec6c56 --- /dev/null +++ b/.github/workflows/action-metadata-lint.yml @@ -0,0 +1,36 @@ +name: Validate Action Metadata + +on: + pull_request: + push: + branches: + - main + +jobs: + action-metadata: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run actionlint + uses: reviewdog/actionlint@v1 + + - name: Verify action runtime and entrypoint convention + run: | + set -euo pipefail + failed=0 + while IFS= read -r action_file; do + if ! grep -Eq "^[[:space:]]*using:[[:space:]]*'node20'[[:space:]]*$" "$action_file"; then + echo "[ERROR] $action_file must set runs.using to 'node20'" + failed=1 + fi + if ! grep -Eq "^[[:space:]]*main:[[:space:]]*'dist/index.js'[[:space:]]*$" "$action_file"; then + echo "[ERROR] $action_file must set runs.main to 'dist/index.js'" + failed=1 + fi + done < <(find . -mindepth 2 -maxdepth 2 -type f -name action.yml | sort) + + if [ "$failed" -ne 0 ]; then + exit 1 + fi diff --git a/notify-on-failure/action.yml b/notify-on-failure/action.yml index 8fc36a0..20794ad 100644 --- a/notify-on-failure/action.yml +++ b/notify-on-failure/action.yml @@ -18,4 +18,4 @@ inputs: required: false runs: using: 'node20' - main: 'dist/index.js' \ No newline at end of file + main: 'dist/index.js' diff --git a/notify-on-failure/package.json b/notify-on-failure/package.json index f88fb0f..bbb8eea 100644 --- a/notify-on-failure/package.json +++ b/notify-on-failure/package.json @@ -1,7 +1,7 @@ { "name": "notify-on-failure", "version": "1.0.0", - "description": "GitHub Action for notifying Slack on push events", + "description": "GitHub Action for notifying Slack on workflow failure events", "main": "dist/index.js", "scripts": { "build": "ncc build index.js -o dist"