-
-
Notifications
You must be signed in to change notification settings - Fork 16
50 lines (39 loc) · 1.32 KB
/
ci.yml
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 README on Push
on:
push:
branches:
- hyde-gallery
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" # Use the latest Python version
- name: Pull the latest changes from remote main branch
run: |
git pull --no-rebase
- name: Run Python script to update README
run: |
python generate_readme.py
- name: Commit changes if any
run: |
git config --local user.name "github-actions"
git config --local user.email "[email protected]"
git add README.md
if git diff-index --cached --quiet HEAD; then
echo "No changes to commit."
else
git commit -m "Update README with new data"
fi
- name: Debug authentication
run: |
echo "Testing push permissions"
git push --dry-run https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git
- name: Push changes to remote repository
if: success() # Ensures the step only runs if previous steps succeeded
run: |
git push https://github-actions[bot]:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}