2323
2424 - name : Install actionlint
2525 run : |
26- bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
26+ # Download actionlint v1.7.9 (pinned version)
27+ curl -sL https://github.com/rhysd/actionlint/releases/download/v1.7.9/actionlint_1.7.9_linux_amd64.tar.gz -o actionlint.tar.gz
28+ tar xzf actionlint.tar.gz
2729 sudo mv ./actionlint /usr/local/bin/
30+ rm actionlint.tar.gz
2831 actionlint --version
2932
3033 - name : Run actionlint
3336 actionlint -color
3437 continue-on-error : false
3538
36- check-action-versions :
37- name : Check Action Versions
38- runs-on : ubuntu-latest
39-
40- steps :
41- - name : Checkout repository
42- uses : actions/checkout@v4
43-
44- - name : Setup Node.js
45- uses : actions/setup-node@v4
46- with :
47- node-version : ' 20'
48-
49- - name : Install action-validator
50- run : npm install -g action-validator
51-
52- - name : Validate action versions
53- run : |
54- echo "Checking for outdated GitHub Actions..."
55- # Find all workflow files and check each one
56- for workflow in .github/workflows/*.yml .github/workflows/*.yaml; do
57- if [ -f "$workflow" ]; then
58- echo "Checking $workflow..."
59- action-validator "$workflow" || true
60- fi
61- done
62- continue-on-error : true
63-
6439 detect-outdated-actions :
6540 name : Detect Outdated Actions
6641 runs-on : ubuntu-latest
9469 echo "No actions found in workflows"
9570 fi
9671
97- - name : Check action availability
72+ - name : Check action availability and versions
73+ env :
74+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9875 run : |
9976 echo "Checking if actions are available on GitHub..."
10077
10380 exit 0
10481 fi
10582
83+ UNAVAILABLE_ACTIONS=""
84+
10685 while IFS= read -r action; do
10786 # Skip local actions (starting with ./)
10887 if [[ "$action" == ./* ]]; then
@@ -116,19 +95,39 @@ jobs:
11695
11796 # Check if action exists
11897 if [[ "$ACTION_PATH" == *"/"* ]]; then
119- REPO_URL="https://github.com/$ACTION_PATH"
12098 echo "Checking $ACTION_PATH@$ACTION_VERSION..."
12199
122- # Use GitHub API to check if repo exists (no auth needed for public repos)
123- HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$REPO_URL")
100+ # Use GitHub API with authentication for better rate limits
101+ API_URL="https://api.github.com/repos/$ACTION_PATH"
102+ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
103+ -H "Authorization: token $GITHUB_TOKEN" \
104+ -H "Accept: application/vnd.github.v3+json" \
105+ "$API_URL")
124106
125107 if [ "$HTTP_CODE" -eq 200 ]; then
126108 echo "✓ Action available: $action"
109+
110+ # Try to fetch latest release for comparison
111+ LATEST_RELEASE=$(curl -s \
112+ -H "Authorization: token $GITHUB_TOKEN" \
113+ -H "Accept: application/vnd.github.v3+json" \
114+ "$API_URL/releases/latest" | grep '"tag_name":' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/' || echo "")
115+
116+ if [ -n "$LATEST_RELEASE" ] && [ "$ACTION_VERSION" != "$LATEST_RELEASE" ]; then
117+ echo " ℹ️ Latest version available: $LATEST_RELEASE (current: $ACTION_VERSION)"
118+ fi
127119 else
128120 echo "✗ Action not found or inaccessible: $action (HTTP $HTTP_CODE)"
121+ UNAVAILABLE_ACTIONS="${UNAVAILABLE_ACTIONS}${action}\n"
129122 fi
130123 fi
131124 done < /tmp/workflow-analysis/unique_actions.txt
125+
126+ if [ -n "$UNAVAILABLE_ACTIONS" ]; then
127+ echo ""
128+ echo "⚠️ Warning: Some actions are unavailable:"
129+ echo -e "$UNAVAILABLE_ACTIONS"
130+ fi
132131
133132 - name : Generate action version report
134133 run : |
@@ -173,7 +172,7 @@ jobs:
173172 summary :
174173 name : Validation Summary
175174 runs-on : ubuntu-latest
176- needs : [validate-workflows, check-action-versions, detect-outdated-actions]
175+ needs : [validate-workflows, detect-outdated-actions]
177176 if : always()
178177
179178 steps :
@@ -186,6 +185,5 @@ jobs:
186185 echo ""
187186 echo "## Jobs Status:"
188187 echo "- Validate Workflows: ${{ needs.validate-workflows.result }}"
189- echo "- Check Action Versions: ${{ needs.check-action-versions.result }}"
190188 echo "- Detect Outdated Actions: ${{ needs.detect-outdated-actions.result }}"
191189 } >> "$GITHUB_STEP_SUMMARY"
0 commit comments