-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.39 KB
/
generate_automation_readme.yaml
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
name: Update Automation README.md
on:
schedule:
- cron: '0 0 * * *' # This runs every day at midnight
workflow_dispatch: # Allows manual triggering
permissions:
contents: write # Grant write permissions
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: pip install pyyaml
- name: Run script
run: python scripts/generate_automation_readme.py
# - name: Check for changes
# id: changes
# run: |
# git diff --quiet || echo "changes=1" >> $GITHUB_ENV
# echo "changes=${{ env.changes || 0 }}" >> $GITHUB_ENV
- name: Commit and push changes
# if: env.changes == '1'
env:
GIT_AUTHOR_EMAIL: [email protected]
GIT_AUTHOR_NAME: GitHub Action
GIT_COMMITTER_EMAIL: [email protected]
GIT_COMMITTER_NAME: GitHub Action
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add automations/README.md
git commit -m "Update Automation Readme"
git push