File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ jobs:
11
11
steps :
12
12
- id : config
13
13
run : |
14
- if [ "${{ github.event_name }}" == 'pull_request' ]
15
- then
16
- echo "::set-output name=ref::${{ github.event.pull_request.head.sha }}"
17
- else
18
- echo "::set-output name=ref::${{ github.ref }}"
14
+ ref=${{ github.ref }}
15
+ if [ "${{ github.event_name }}" == 'pull_request' ]; then
16
+ ref="${{ github.event.pull_request.head.sha }}"
19
17
fi
18
+ ref="${ref#refs/heads/}"
19
+ echo "::set-output name=ref::$ref"
20
20
21
21
git config --global user.name github-actions
22
22
git config --global user.email [email protected]
@@ -75,12 +75,12 @@ jobs:
75
75
steps :
76
76
- id : config
77
77
run : |
78
- if [ "${{ github.event_name }}" == 'pull_request' ]
79
- then
80
- echo "::set-output name=ref::${{ github.event.pull_request.head.sha }}"
81
- else
82
- echo "::set-output name=ref::${{ github.ref }}"
78
+ ref=${{ github.ref }}
79
+ if [ "${{ github.event_name }}" == 'pull_request' ]; then
80
+ ref="${{ github.event.pull_request.head.sha }}"
83
81
fi
82
+ ref="${ref#refs/heads/}"
83
+ echo "::set-output name=ref::$ref"
84
84
85
85
git config --global user.name github-actions
86
86
git config --global user.email [email protected]
You can’t perform that action at this time.
0 commit comments