From 96aeac03a33e375237109ebcab45a5eade0a5f82 Mon Sep 17 00:00:00 2001 From: "Alejandro R. Mosteo" Date: Fri, 25 Oct 2024 12:59:40 +0200 Subject: [PATCH] Use appropriate commit for push/pr --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c246df..a9c127c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,13 +50,19 @@ jobs: verbose: true # Produce an Alire release manifest - - name: Make Release Manifest + - name: Configure Github credentials run: | # Set user GitHub login required for `alr publish` alr config --set --global user.github_login ${{github.repository_owner}} - # Run Alire publish assistant - alr publish ${{github.server_url}}/${{github.repository}} ${{github.sha}} + # Run Alire publish assistant with the appropriate commit + alr publish ${{github.server_url}}/${{github.repository}} ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + + - if: github.event_name == 'pull_request' + run: alr publish ${{github.server_url}}/${{github.repository}} ${{ github.event.pull_request.head.sha }} + + - if: github.event_name == 'push' + run: alr publish ${{github.server_url}}/${{github.repository}} ${{ github.sha }} # Save the path to the release manifest for the next step. # This is a little trick to get around the fact that the actions/upload-release-asset doesn't allow globing pattern.