File tree 2 files changed +21
-18
lines changed
2 files changed +21
-18
lines changed Original file line number Diff line number Diff line change 52
52
53
53
- name : Get API changes
54
54
id : api-changed
55
- uses : tj-actions/changed-files@v34.5.3
55
+ uses : tj-actions/changed-files@v35.1.1
56
56
with :
57
57
base_sha : ' HEAD~1'
58
58
sha : ' HEAD'
Original file line number Diff line number Diff line change @@ -29,29 +29,32 @@ jobs:
29
29
with :
30
30
mode : fix
31
31
32
- - name : Apply Changes
32
+ - name : List files changed
33
+ id : files-changed
33
34
shell : bash -l {0}
34
35
run : |
35
- git config user.name 'github-actions[bot]'
36
- git config user.email 'github-actions[bot]@users.noreply.github.com'
37
- git add *
38
- git commit --allow-empty -m "Automatic application of license header"
36
+ set -ex
37
+ export CHANGES=$(git status --porcelain | tee modified.log | wc -l)
38
+ cat modified.log
39
+ # Remove the log otherwise it will be committed
40
+ rm modified.log
39
41
40
- - name : Get modified files in the staging directory
41
- id : changed-files
42
- uses :
tj-actions/[email protected]
43
- with :
44
- since_last_remote_commit : " true"
45
- sha : ' HEAD'
42
+ echo "N_CHANGES=${CHANGES}" >> $GITHUB_OUTPUT
46
43
47
- - name : Push fixes
48
- if : steps.changed-files.outputs.any_changed == 'true'
44
+ git diff
45
+
46
+ - name : Commit any changes
47
+ if : steps.files-changed.outputs.N_CHANGES != '0'
49
48
shell : bash -l {0}
50
49
run : |
51
- echo "Changed files:"
52
- for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
53
- echo " $file"
54
- done
50
+ git config user.name "github-actions[bot]"
51
+ git config user.email "github-actions[bot]@users.noreply.github.com"
52
+
53
+ git pull --no-tags
54
+
55
+ git add *
56
+ git commit -m "Automatic application of license header"
57
+
55
58
git config push.default upstream
56
59
git push
57
60
env :
You can’t perform that action at this time.
0 commit comments