File tree Expand file tree Collapse file tree 1 file changed +26
-13
lines changed Expand file tree Collapse file tree 1 file changed +26
-13
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ name: Fix License Headers
3
3
on :
4
4
pull_request_target :
5
5
6
- permissions :
7
- contents : write
8
- pull-requests : write
9
-
10
6
jobs :
11
7
header-license-fix :
12
8
runs-on : ubuntu-20.04
9
+
10
+ permissions :
11
+ contents : write
12
+ pull-requests : write
13
+
13
14
steps :
14
15
- name : Checkout
15
16
uses : actions/checkout@v3
@@ -29,23 +30,35 @@ jobs:
29
30
with :
30
31
mode : fix
31
32
32
- - name : Get modified files in the staging directory
33
- id : changed-files
34
- uses : tj-actions/changed-files@v34
35
-
36
- - name : Apply Changes
37
- if : steps.changed-files.outputs.any_changed == 'true'
33
+ - name : Commit any changes
38
34
shell : bash -l {0}
39
35
run : |
40
- git config user.name 'github-actions[bot]'
41
- git config user.email 'github-actions[bot]@users.noreply.github.com'
36
+ git config user.name "github-actions[bot]"
37
+ git config user.email "github-actions[bot]@users.noreply.github.com"
38
+
39
+ git pull --no-tags
42
40
git add *
43
- git commit -m "Automatic application of license header"
41
+ git commit --allow-empty -m "Automatic application of license header"
42
+ env :
43
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44
+
45
+ - name : Get modified files
46
+ id : changed-files
47
+ uses : tj-actions/changed-files@v34
48
+ with :
49
+ base_sha : ' HEAD~1'
50
+ sha : ' HEAD'
44
51
45
52
- name : Push fixes
46
53
if : steps.changed-files.outputs.any_changed == 'true'
47
54
shell : bash -l {0}
48
55
run : |
56
+ echo "Changed files"
57
+ for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
58
+ echo " $file"
59
+ done
60
+ git diff HEAD~1
61
+
49
62
git config push.default upstream
50
63
git push
51
64
env :
You can’t perform that action at this time.
0 commit comments