Skip to content

Commit 96aeac0

Browse files
committed
Use appropriate commit for push/pr
1 parent ba25e93 commit 96aeac0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/main.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,19 @@ jobs:
5050
verbose: true
5151

5252
# Produce an Alire release manifest
53-
- name: Make Release Manifest
53+
- name: Configure Github credentials
5454
run: |
5555
# Set user GitHub login required for `alr publish`
5656
alr config --set --global user.github_login ${{github.repository_owner}}
5757
58-
# Run Alire publish assistant
59-
alr publish ${{github.server_url}}/${{github.repository}} ${{github.sha}}
58+
# Run Alire publish assistant with the appropriate commit
59+
alr publish ${{github.server_url}}/${{github.repository}} ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
60+
61+
- if: github.event_name == 'pull_request'
62+
run: alr publish ${{github.server_url}}/${{github.repository}} ${{ github.event.pull_request.head.sha }}
63+
64+
- if: github.event_name == 'push'
65+
run: alr publish ${{github.server_url}}/${{github.repository}} ${{ github.sha }}
6066

6167
# Save the path to the release manifest for the next step.
6268
# This is a little trick to get around the fact that the actions/upload-release-asset doesn't allow globing pattern.

0 commit comments

Comments
 (0)