|
name: Scheduled Maintenance |
|
|
|
on: |
|
schedule: |
|
# Runs after the 04:00 CPython sync so the status table and headers |
|
# reflect today's msgids instead of yesterday's. |
|
- cron: '0 5 * * *' |
|
workflow_dispatch: {} |
|
|
|
permissions: |
|
contents: write |
|
issues: write |
|
pull-requests: read |
|
|
|
# Shared with sync-cpython.yml so the two never push at the same time. |
|
concurrency: |
|
group: repo-writes |
|
cancel-in-progress: false |
|
|
|
jobs: |
|
maintenance: |
|
runs-on: ubuntu-latest |
|
timeout-minutes: 30 |
|
steps: |
|
- uses: actions/checkout@v4 |
|
with: |
|
fetch-depth: 0 # needed if team_stats/contributor_chart read git history |
|
|
|
- name: Set up Python |
|
uses: actions/setup-python@v4 |
|
with: |
|
python-version: '3.12' |
|
|
|
- name: Install dependencies |
|
run: pip install polib matplotlib |
|
|
|
- name: Update translation status table |
|
run: python3 scripts/generate_status_table.py |
|
|
|
- name: Update PO file headers |
|
run: python3 scripts/update_po_headers.py --merge --no-last-translator |
|
|
|
- name: Update TEAM.md contributor counts |
|
run: python3 scripts/team_stats.py --update-teammd |
|
|
|
- name: Update contributor chart and README stats block |
|
run: python3 scripts/contributor_chart.py |
|
|
|
- name: Update master issue with pending review items |
|
env: |
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
MASTER_ISSUE: '83' |
|
run: python3 scripts/update_master_issue.py |
|
|
|
- name: Stage changes |
|
run: git add --all |
|
|
|
# Drops .po files whose only change is POT-Creation-Date. |
|
- name: Unstage POT-Creation-Date-only changes |
|
run: python3 scripts/unstage_cosmetic.py |
|
|
|
- name: Commit and push if changed |
|
run: | |
|
git config user.name "github-actions[bot]" |
|
git config user.email "github-actions[bot]@users.noreply.github.com" |
|
if git diff --staged --quiet; then |
|
echo "No changes to commit" |
|
exit 0 |
|
fi |
|
git commit -m "chore: update translation status, PO headers, team credits, and contributor chart" |
|
git pull --rebase |
|
git push |