Skip to content
Merged
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
37 changes: 37 additions & 0 deletions .github/workflows/validate-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validate actions metadata

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install actionlint
run: |
curl -sSL \
https://github.com/rhysd/actionlint/releases/download/v1.7.12/actionlint_1.7.12_linux_amd64.tar.gz \
-o actionlint.tar.gz
tar -xzf actionlint.tar.gz actionlint
sudo mv actionlint /usr/local/bin/actionlint

- name: Run actionlint
run: actionlint

metadata:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate action.yml standards
run: ./scripts/validate-actions.sh
4 changes: 4 additions & 0 deletions notify-on-branch-delete/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ inputs:
description: 'Telegram Chat ID'
required: false

branding:
icon: 'bell'
color: 'blue'

runs:
using: 'node20'
main: 'dist/index.js'
4 changes: 4 additions & 0 deletions notify-on-commit-comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
telegram_chat_id:
description: 'Telegram Chat ID'
required: false
branding:
icon: 'bell'
color: 'blue'

runs:
using: 'node20'
main: 'dist/index.js'
4 changes: 4 additions & 0 deletions notify-on-failure/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
job_name:
description: 'Name of the failed job'
required: false
branding:
icon: 'bell'
color: 'blue'

runs:
using: 'node20'
main: 'dist/index.js'
4 changes: 4 additions & 0 deletions notify-on-issue/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
telegram_chat_id:
description: 'Telegram Chat ID'
required: false
branding:
icon: 'bell'
color: 'blue'

runs:
using: 'node20'
main: 'dist/index.js'
4 changes: 4 additions & 0 deletions notify-on-pr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
github_token:
description: 'GitHub Token for fetching PR details'
required: true
branding:
icon: 'bell'
color: 'blue'

runs:
using: 'node20'
main: 'dist/index.js'
4 changes: 4 additions & 0 deletions notify-on-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ inputs:
required: false
default: 'false'

branding:
icon: 'bell'
color: 'blue'

runs:
using: 'node20'
main: 'dist/index.js'
4 changes: 4 additions & 0 deletions notify-on-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
telegram_chat_id:
description: 'Telegram Chat ID'
required: false
branding:
icon: 'bell'
color: 'blue'

runs:
using: 'node20'
main: 'dist/index.js'
29 changes: 29 additions & 0 deletions scripts/validate-actions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"

fail() {
echo "[FAIL] $1" >&2
exit 1
}

echo "Validating action metadata..."

mapfile -t action_files < <(find . -mindepth 2 -maxdepth 2 -name action.yml | sort)
[[ ${#action_files[@]} -gt 0 ]] || fail "No action.yml files found"

for file in "${action_files[@]}"; do
dir="$(dirname "$file")"
echo "- $file"

grep -Eq "^runs:" "$file" || fail "$file: missing runs block"
grep -Eq "^[[:space:]]+using:[[:space:]]*'node20'" "$file" || fail "$file: runs.using must be 'node20'"
grep -Eq "^[[:space:]]+main:[[:space:]]*'dist/index.js'" "$file" || fail "$file: runs.main must be 'dist/index.js'"
grep -Eq "^branding:" "$file" || fail "$file: missing branding block"

[[ -f "$dir/dist/index.js" ]] || fail "$dir/dist/index.js is missing"
done

echo "Metadata validation passed"
Loading