-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.13 KB
/
main.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
permissions: # Global permissions configuration starts here
contents: write # 'read' access to repository contents
pull-requests: write # 'write' access to pull requests
name: update-readme
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Run the script
run: python .github/update_readme.py
- name: Commit files
run: |
git config --local user.name "Github Action"
git config --local user.email "[email protected]"
git add README.md
if git diff-index --quiet HEAD --; then
echo "changes_to_push=false" >> $GITHUB_ENV
else
git commit -m "Updated README"
echo "changes_to_push=true" >> $GITHUB_ENV
fi
- name: Push changes # push the output folder to your repo
if: ${{ env.changes_to_push == 'true' }}
uses: ad-m/github-push-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
force: true