-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsync-awesome-software-engineering-games.yml
More file actions
68 lines (60 loc) · 2.38 KB
/
Copy pathsync-awesome-software-engineering-games.yml
File metadata and controls
68 lines (60 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Sync awesome-software-engineering-games
on:
workflow_dispatch:
repository_dispatch:
types: [game-list-update]
jobs:
sync-awesome-software-engineering-games:
name: Sync awesome-software-engineering-games from external repository
runs-on: ubuntu-24.04
defaults:
run:
working-directory: website-admin
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26"
- name: Build
run: make build
# Updates the Awesome Software Engineering Games data
# from https://github.com/EngineeringKiosk/awesome-software-engineering-games
- name: website-admin sync awesome-software-engineering-games
run: |
./website-admin sync awesome-software-engineering-games
# Commit results back to repository
- name: Commit changes
id: auto-commit
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit_message: "chore: Update the latest data from awesome-software-engineering-games"
branch: main
commit_user_name: "GitHub Actions Bot"
commit_user_email: "actions@github.com"
commit_author: "GitHub Actions Bot <actions@github.com>"
skip_push: true
- name: Configure git identity for rebase
if: steps.auto-commit.outputs.changes_detected == 'true'
working-directory: ${{ github.workspace }}
run: |
git config user.name "GitHub Actions Bot"
git config user.email "actions@github.com"
- name: Push changes with retry
if: steps.auto-commit.outputs.changes_detected == 'true'
working-directory: ${{ github.workspace }}
run: |
max_retries=3
for attempt in $(seq 1 $max_retries); do
echo "Push attempt $attempt of $max_retries"
if git push origin main; then
echo "Push succeeded on attempt $attempt"
exit 0
fi
echo "Push failed, pulling with rebase and retrying..."
git pull --rebase origin main
sleep $((attempt * 2))
done
echo "Push failed after $max_retries attempts"
exit 1