Skip to content

Commit ec3c571

Browse files
committed
Update stats generation
1 parent f35efb5 commit ec3c571

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

.github/workflows/stats.yaml

+33-17
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,46 @@ jobs:
99
# Credit: https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions
1010
- name: Extract branch name
1111
#run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
12-
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/}) >> $GITHUB_OUTPUT"
12+
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
1313
id: extract_branch
1414
- uses: actions/checkout@v4
1515
with:
1616
ref: ${{ steps.extract_branch.outputs.branch }}
1717
- run: ${{ github.workspace }}/.github/scripts/gen_stats.sh
18-
- run: |
19-
git status
20-
git branch
18+
- name: Commit changes
19+
run: |-
20+
for r in $(git remote) ; do git remote get-url --all $r ; done
2121
git config user.name github-actions
2222
git config user.email [email protected]
23-
git add .
24-
git commit -m '[Bot] stats - Update STATS.md'
23+
git commit -a -m '[Bot] stats - Update STATS.md'
2524
git push
26-
- name: Commit updated resources
27-
if: false
28-
uses: test-room-7/action-update-file@v1
29-
with:
30-
file-path: STATS.md
31-
commit-msg: '[Bot] stats - Update STATS.md'
32-
github-token: ${{ secrets.GITHUB_TOKEN }}
33-
# - uses: stefanzweifel/git-auto-commit-action@v4
34-
# with:
35-
# commit_message: '[Bot] stats - Update STATS.md'
36-
# commit_user_name: stats
3725
# commit_user_email: stats@nill
3826
# commit_author: STATS BOT <stats>
27+
- uses: dorny/paths-filter@v2
28+
id: changes
29+
with:
30+
filters: |
31+
man:
32+
- 'man.md'
33+
autotools:
34+
- 'aclocal.m4'
35+
- 'configure.ac'
36+
- uses: docker://pandoc/core:2.17
37+
if: ${{ github.event_name == 'workflow_dispath' || steps.changes.outputs.man == 'true' }}
38+
with:
39+
args: -s man.md -t man -o shc.1
40+
- uses: docker://pandoc/core:2.17
41+
if: ${{ github.event_name == 'workflow_dispath' || steps.changes.outputs.man == 'true' }}
42+
with:
43+
args: -s man.md -t html -o man.html
44+
- run: |-
45+
./autogen.sh
46+
if: ${{ github.event_name == 'workflow_dispath' || steps.changes.outputs.autotools == 'true' }}
47+
- name: Commit changes
48+
if: ${{ github.event_name == 'workflow_dispath' || steps.changes.outputs.man == 'true' || steps.changes.outputs.autotools }}
49+
run: |-
50+
for r in $(git remote) ; do git remote get-url --all $r ; done
51+
git config user.name github-actions
52+
git config user.email [email protected]
53+
git commit -a -m "ci: Github Action Generate Files"
54+
git push

0 commit comments

Comments
 (0)