|
3 | 3 | # Update deprecated GitHub Actions |
4 | 4 | echo "Updating deprecated GitHub Actions..." |
5 | 5 |
|
6 | | -# Update checkout v3 to v4 |
| 6 | +# Update core actions |
7 | 7 | find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/actions\/checkout@v3/actions\/checkout@v4/g' |
8 | | - |
9 | | -# Update setup-node v3 to v4 |
10 | 8 | find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/actions\/setup-node@v3/actions\/setup-node@v4/g' |
11 | | - |
12 | | -# Update github-script v3 to v7 |
13 | 9 | find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/actions\/github-script@v3/actions\/github-script@v7/g' |
14 | | - |
15 | | -# Update upload-artifact v3 to v4 |
16 | 10 | find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/actions\/upload-artifact@v3/actions\/upload-artifact@v4/g' |
17 | | - |
18 | | -# Update download-artifact v3 to v4 |
19 | 11 | find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/actions\/download-artifact@v3/actions\/download-artifact@v4/g' |
20 | 12 |
|
| 13 | +# Update CodeQL actions from v2 to v3 |
| 14 | +find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/github\/codeql-action\/init@v2/github\/codeql-action\/init@v3/g' |
| 15 | +find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/github\/codeql-action\/analyze@v2/github\/codeql-action\/analyze@v3/g' |
| 16 | + |
| 17 | +# Update Firebase action to latest version |
| 18 | +find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/FirebaseExtended\/action-hosting-deploy@276388dd6c2cde23455b30293105cc866c22282d # v0.6-alpha/FirebaseExtended\/action-hosting-deploy@v0/g' |
| 19 | + |
| 20 | +# Update machine-learning-apps action from @master to specific version |
| 21 | +find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs sed -i '' 's/machine-learning-apps\/actions-app-token@master/machine-learning-apps\/actions-app-token@v1/g' |
| 22 | + |
21 | 23 | echo "Done updating GitHub Actions!" |
22 | 24 |
|
23 | 25 | # Check for any remaining deprecated actions |
24 | 26 | echo "Checking for remaining deprecated actions..." |
25 | | -grep -r "actions/.*@v[123]" .github/workflows/ || echo "No deprecated actions found!" |
| 27 | +echo "=== Core Actions ===" |
| 28 | +grep -r "actions/checkout@v[123]" .github/workflows/ && echo "❌ Found deprecated checkout actions" || echo "✅ All checkout actions updated" |
| 29 | +grep -r "actions/setup-node@v[123]" .github/workflows/ && echo "❌ Found deprecated setup-node actions" || echo "✅ All setup-node actions updated" |
| 30 | +grep -r "actions/upload-artifact@v[123]" .github/workflows/ && echo "❌ Found deprecated upload-artifact actions" || echo "✅ All upload-artifact actions updated" |
| 31 | +grep -r "actions/download-artifact@v[123]" .github/workflows/ && echo "❌ Found deprecated download-artifact actions" || echo "✅ All download-artifact actions updated" |
| 32 | +grep -r "actions/github-script@v[123]" .github/workflows/ && echo "❌ Found deprecated github-script actions" || echo "✅ All github-script actions updated" |
| 33 | + |
| 34 | +echo "=== CodeQL Actions ===" |
| 35 | +grep -r "codeql-action.*@v[12]" .github/workflows/ && echo "❌ Found deprecated CodeQL actions" || echo "✅ All CodeQL actions updated" |
| 36 | + |
| 37 | +echo "=== Other Actions ===" |
| 38 | +grep -r "@master" .github/workflows/ && echo "⚠️ Found actions using @master branch" || echo "✅ No actions using @master branch" |
| 39 | +grep -r "276388dd6c2cde23455b30293105cc866c22282d" .github/workflows/ && echo "❌ Found pinned Firebase action commit" || echo "✅ Firebase action updated to latest" |
| 40 | + |
| 41 | +echo "=== Summary ===" |
| 42 | +echo "All GitHub Actions have been updated to their latest stable versions." |
0 commit comments