|
6 | 6 | # - cron: "15 * * * *" # every hour at :15 |
7 | 7 | - cron: "15 9 * * *" # every day at 09:15 UTC |
8 | 8 |
|
9 | | -permissions: |
10 | | - contents: write # needed to commit updates to releases.json |
11 | | - |
12 | 9 | jobs: |
13 | 10 | update: |
14 | 11 | runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: write # needed to commit updates to releases.json |
15 | 14 |
|
16 | 15 | strategy: |
17 | 16 | max-parallel: 1 |
@@ -52,19 +51,13 @@ jobs: |
52 | 51 | - aboutcode-org/www.aboutcode.org |
53 | 52 | # Add more repos here |
54 | 53 |
|
55 | | - env: |
56 | | - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
57 | | - GITHUB_TOKEN: ${{ secrets.GH_REPO_POLLING }} |
58 | | - |
59 | 54 | steps: |
60 | | - |
61 | 55 | # 1 Checkout the target repo (Repo B) |
62 | 56 | - name: Checkout repository |
63 | | - uses: actions/checkout@v4 |
| 57 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
64 | 58 | with: |
65 | 59 | ref: main |
66 | 60 | fetch-depth: 0 |
67 | | - token: ${{ secrets.GH_REPO_POLLING }} |
68 | 61 |
|
69 | 62 | # 2 Debug: show which repo is being processed |
70 | 63 | - name: Debug - current repo |
@@ -117,14 +110,10 @@ jobs: |
117 | 110 | # 5 Commit & push changes if releases.json changed |
118 | 111 | - name: Commit and push if changed |
119 | 112 | run: | |
120 | | - git config user.name "github-actions" |
121 | | - git config user.email "github-actions@github.com" |
| 113 | + git config user.name "AboutCode Automation" |
| 114 | + git config user.email "automation@aboutcode.org" |
122 | 115 | git add website/static/releases.json |
123 | | - if ! git diff --cached --quiet; then |
124 | | - git commit -m "Update releases for ${{ matrix.repo }}" |
125 | | - git pull --rebase origin main |
126 | | - git push |
127 | | - else |
128 | | - echo "No changes detected" |
129 | | - fi |
| 116 | + git commit -m "$(echo -e "Update releases for ${{ matrix.repo }}\n\nSigned-off-by: AboutCode Automation <automation@aboutcode.org>")" || exit 0 |
| 117 | + git pull --rebase origin main |
| 118 | + git push |
130 | 119 | shell: bash |
0 commit comments