|
9 | 9 | # Credit: https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions
|
10 | 10 | - name: Extract branch name
|
11 | 11 | #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 |
13 | 13 | id: extract_branch
|
14 | 14 | - uses: actions/checkout@v4
|
15 | 15 | with:
|
16 | 16 | ref: ${{ steps.extract_branch.outputs.branch }}
|
17 | 17 | - 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 |
21 | 21 | git config user.name github-actions
|
22 | 22 | 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' |
25 | 24 | 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 |
37 | 25 | # commit_user_email: stats@nill
|
38 | 26 | # 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