@@ -11,8 +11,8 @@ name: weekly-refresh
1111# Token model: TechAPI is public, so the checkout uses the default GITHUB_TOKEN
1212# (read-only) as a fallback — that lets the collect→validate→dump path run on
1313# every push even when no PAT is configured. Only the cross-repo PR needs write
14- # access, so just that step is guarded by `secrets.TECHAPI_TOKEN`. Add the PAT
15- # (TechAPI Contents:write + Pull requests:write) as TECHAPI_TOKEN to enable PRs .
14+ # access, so just that step is guarded by a PAT. Prefer TECHENGINEBOT_TOKEN
15+ # so PRs are authored by TechEngineBot; fall back to TECHAPI_TOKEN .
1616on :
1717 schedule :
1818 - cron : " 0 6 * * 1" # Mondays 06:00 UTC (live scrape: weekly to respect upstream ToS/rate limits)
3636 env :
3737 SLEEP : ${{ inputs.sleep || '1.0' }}
3838 TECHAPI_TOKEN : ${{ secrets.TECHAPI_TOKEN }}
39+ TECHAPI_WRITE_TOKEN : ${{ secrets.TECHENGINEBOT_TOKEN || secrets.TECHAPI_TOKEN }}
3940 # Validate/seed/dump all read the data tree from this env var.
4041 TECHAPI_DATA_DIR : ${{ github.workspace }}/techapi/data
4142 steps :
4950 with :
5051 repository : GetTechAPI/TechAPI
5152 path : techapi
52- token : ${{ secrets.TECHAPI_TOKEN || secrets.GITHUB_TOKEN }}
53+ token : ${{ secrets.TECHENGINEBOT_TOKEN || secrets. TECHAPI_TOKEN || secrets.GITHUB_TOKEN }}
5354
5455 - uses : actions/setup-python@v5
5556 with :
@@ -137,7 +138,7 @@ jobs:
137138
138139 # Fallback when no PAT: keep the regenerated dump so the work isn't lost.
139140 - name : Upload dump artifact (no-token fallback)
140- if : env.TECHAPI_TOKEN == ''
141+ if : env.TECHAPI_WRITE_TOKEN == ''
141142 uses : actions/upload-artifact@v4
142143 with :
143144 name : dump-${{ steps.meta.outputs.date }}
@@ -148,11 +149,11 @@ jobs:
148149
149150 # --- 4. Dated branch + auto PR against TechAPI (only with a PAT) ---
150151 - name : Create refresh PR
151- if : env.TECHAPI_TOKEN != ''
152+ if : env.TECHAPI_WRITE_TOKEN != ''
152153 uses : peter-evans/create-pull-request@v6
153154 with :
154155 path : ./techapi
155- token : ${{ secrets.TECHAPI_TOKEN }}
156+ token : ${{ env.TECHAPI_WRITE_TOKEN }}
156157 branch : refresh/${{ steps.meta.outputs.date }}
157158 base : main
158159 add-paths : |
0 commit comments