@@ -4,6 +4,9 @@ description: |
4
4
The action expects a python script to be executed
5
5
6
6
inputs :
7
+ token :
8
+ description : The Github token to use to perform commit.
9
+ required : true
7
10
python_libs :
8
11
description : |
9
12
Required libraries to execute the python script
@@ -25,9 +28,6 @@ outputs:
25
28
changes_detected :
26
29
description : Value is "true", if the repository was dirty and file changes have been detected. Value is "false", if no changes have been detected.
27
30
value : ${{ steps.commit.outputs.changes_detected }}
28
- commit_hash :
29
- description : Full hash of the created commit. Only present if the "changes_detected" output is "true".
30
- value : ${{ steps.commit.outputs.commit_hash }}
31
31
32
32
runs :
33
33
using : composite
58
58
python /tmp/update_repository.py
59
59
shell : bash
60
60
61
- - name : commit and push changes
61
+ - name : Commit and push changes
62
62
id : commit
63
- uses : stefanzweifel/git-auto-commit-action@v4
64
- with :
65
- commit_message : ${{ inputs.commit_message }}
66
- file_pattern : ${{ inputs.file_pattern }}
63
+ run : |
64
+ if [[ -n $(git status -s) ]]; then
65
+ echo -e "changes detected\n$(git status -s)"
66
+ git add -A ${{ inputs.file_pattern }}
67
+ git -c user.name="$GIT_USER_NAME" -c user.email="$GIT_USER_EMAIL" commit -m "${{ inputs.commit_message }}" --author="$GIT_AUTHOR"
68
+ git push origin ${{ github.head_ref }}
69
+ echo "changes_detected=true" >> $GITHUB_OUTPUT
70
+ else
71
+ echo "changes_detected=false" >> $GITHUB_OUTPUT
72
+ fi
73
+ shell : bash
74
+ env :
75
+ GITHUB_TOKEN : ${{ inputs.token }}
76
+ GIT_USER_NAME : " github-actions[bot]"
77
+ GIT_USER_EMAIL : " 41898282+github-actions[bot]@users.noreply.github.com"
78
+ GIT_AUTHOR : " ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
0 commit comments