Skip to content

Commit ece3604

Browse files
committed
Use unqualified reference for checkout, when applicable
1 parent ae67c25 commit ece3604

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/update.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
steps:
1212
- id: config
1313
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 }}"
1917
fi
18+
ref="${ref#refs/heads/}"
19+
echo "::set-output name=ref::$ref"
2020
2121
git config --global user.name github-actions
2222
git config --global user.email [email protected]
@@ -75,12 +75,12 @@ jobs:
7575
steps:
7676
- id: config
7777
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 }}"
8381
fi
82+
ref="${ref#refs/heads/}"
83+
echo "::set-output name=ref::$ref"
8484
8585
git config --global user.name github-actions
8686
git config --global user.email [email protected]

0 commit comments

Comments
 (0)