Skip to content

Commit 366cc68

Browse files
Daniel Jonesclaude
andcommitted
chore(ci): refresh vended v3/languages responses hourly
Adds .github/workflows/refresh-v3-languages.yml: an hourly cron (plus manual workflow_dispatch) that runs scripts/fetch_v3_languages.py against api.deepl.com using the DEEPL_API_KEY repo secret, then uses peter-evans/create-pull-request@v6 to open (and update in place) a PR against main whenever data/v3-languages/** changes. A concurrency group guards against cron + manual runs racing for the same branch. peter-evans behavior on subsequent runs: - Responses unchanged: the action compares trees, not commit SHAs, so a fresh timestamp alone does not cause a push. Branch is left as-is. - Responses changed: the branch is force-pushed with a new single squashed commit so the diff against main always represents the current API state in one reviewable chunk. - Responses now match main (typically right after the PR was merged): the action closes the PR and deletes the branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 16178cf commit 366cc68

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Refresh vended v3/languages responses
2+
3+
on:
4+
schedule:
5+
# Top of every hour.
6+
- cron: "0 * * * *"
7+
# Allow the job to be triggered manually from the Actions tab.
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
concurrency:
15+
group: refresh-v3-languages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
refresh:
20+
name: Fetch and open PR on diff
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v5
25+
26+
- name: Fetch latest /v3/languages responses
27+
env:
28+
DEEPL_AUTH_KEY: ${{ secrets.DEEPL_API_KEY }}
29+
run: python3 scripts/fetch_v3_languages.py
30+
31+
- name: Open or update refresh PR
32+
uses: peter-evans/create-pull-request@v6
33+
with:
34+
branch: chore/refresh-v3-languages
35+
base: main
36+
commit-message: "chore(v3-languages): refresh vended responses"
37+
title: "chore(v3-languages): refresh vended responses"
38+
body: |
39+
Automated refresh of `data/v3-languages/` from `https://api.deepl.com/v3/languages`,
40+
opened by the `refresh-v3-languages` workflow.
41+
42+
This PR is rewritten in place on each run: if the vended responses change again
43+
before merge, the branch is force-pushed with a new single squashed commit so the
44+
diff against `main` always reflects the latest API state. If a run finds the
45+
responses identical to what is already on the branch, the branch is left untouched.
46+
If a run finds the responses match `main` (e.g. the PR was merged), this PR is
47+
closed and the branch deleted automatically.
48+
add-paths: data/v3-languages/**
49+
delete-branch: true
50+
labels: automated, v3-languages

0 commit comments

Comments
 (0)