Skip to content

Commit 9449f48

Browse files
author
Sanajit Jana
committed
Update action script
1 parent 29cde15 commit 9449f48

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

.github/workflows/pages.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,50 @@ on:
77
paths-ignore:
88
- 'README.md'
99

10+
permissions:
11+
contents: write
12+
pages: write
13+
id-token: write
14+
1015
jobs:
16+
update-readme:
17+
if: github.actor != 'github-actions[bot]'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: "3.x"
28+
29+
- name: Debug - List directories
30+
run: |
31+
echo "Listing problem directories in p folder:"
32+
find p -type d -mindepth 1 -maxdepth 1 2>/dev/null | sort || true
33+
echo "Total:"
34+
find p -type d -mindepth 1 -maxdepth 1 2>/dev/null | wc -l || true
35+
36+
- name: Run update script
37+
run: python .github/scripts/update_readme.py
38+
39+
- name: Debug - Show updated README
40+
run: cat README.md
41+
42+
- name: Commit changes
43+
run: |
44+
git config --global user.name "github-actions[bot]"
45+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
46+
git add README.md
47+
git commit -m "Update README.md [skip ci]" || echo "No changes to commit"
48+
git push
49+
1150
deploy:
51+
needs: update-readme
1252
if: github.actor != 'github-actions[bot]'
1353
runs-on: ubuntu-latest
14-
permissions:
15-
contents: read
16-
pages: write
17-
id-token: write
1854
environment:
1955
name: github-pages
2056
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/update-readme.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,15 @@ jobs:
4444
git add README.md
4545
git commit -m "Update README.md [skip ci]" || echo "No changes to commit"
4646
git push
47+
48+
trigger-pages:
49+
needs: update-readme
50+
if: github.actor != 'github-actions[bot]'
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Trigger Pages Deployment
54+
run: |
55+
curl -X POST \
56+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
57+
-H "Accept: application/vnd.github.v3+json" \
58+
https://api.github.com/repos/${{ github.repository }}/pages/builds

0 commit comments

Comments
 (0)