-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.51 KB
/
update_last_commit.yml
File metadata and controls
53 lines (45 loc) · 1.51 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
name: Update last commit of each project
on:
schedule:
# Runs every Sunday, at 00:00 . For more, check out https://crontab.guru/#0_0_*_*_0
- cron: "0 0 * * 0"
workflow_dispatch: # Allow manual triggering
jobs:
update-last-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/base.txt
- name: Run update script
run: |
python ./scripts/update_last_commit.py
python ./scripts/generate_rst_files.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for changes
id: git-check
run: |
git diff --exit-code || echo "::set-output name=changes::true"
- name: Commit and push if changed
if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "chore: Update last commit information"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger build workflow
if: steps.git-check.outputs.changes == 'true'
uses: peter-evans/repository-dispatch@v3
with:
event-type: trigger-build