File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change 1
1
name : Update CHANGES File
2
2
on :
3
- push :
4
- paths-ignore :
5
- - ' CHANGES'
3
+ pull_request :
4
+ types : [opened]
6
5
branches :
7
6
- master
8
7
jobs :
9
8
update-changes :
10
9
runs-on : ubuntu-latest
11
10
steps :
12
- - uses : actions/checkout@master
11
+ - uses : actions/checkout@v2
13
12
with :
14
13
persist-credentials : false
15
14
fetch-depth : 0
15
+
16
+ - name : Get changed files
17
+ id : changed-files
18
+ uses :
tj-actions/[email protected]
19
+
16
20
- name : Update CHANGES file
21
+ if : " !contains(steps.changed-files.outputs.all_changed_files, 'CHANGES')"
17
22
run : |
18
- COMMIT="${{ github.event.head_commit.message }}"
19
- PR_TITLE=`echo "${COMMIT}" | head -n 1`
20
- echo "* ${PR_TITLE}" Thanks @${{ github.actor }} > TMP_CHANGES
21
- cat CHANGES >> TMP_CHANGES
22
- mv TMP_CHANGES CHANGES
23
+ echo "${{ github.event.pull_request.title }}"
24
+ echo "* ${{ github.event.pull_request.title }} (#${{ github.event.pull_request.number }}). Thanks @${{ github.actor }}" > CHANGES2
25
+ cat CHANGES >> CHANGES2
26
+ mv CHANGES2 CHANGES
23
27
- name : Commit & Push changes
28
+ if : " !contains(steps.changed-files.outputs.all_changed_files, 'CHANGES')"
24
29
uses : actions-js/push@master
25
30
with :
26
31
github_token : ${{ secrets.GITHUB_TOKEN }}
27
- branch : master
28
- message : ${{ github.event.head_commit.message }}
32
+ branch : ${{ github.head_ref }}
33
+ message : " Update CHANGES file "
You can’t perform that action at this time.
0 commit comments