Skip to content

Commit

Permalink
Use appropriate commit for push/pr
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Oct 25, 2024
1 parent ba25e93 commit ffaf2d4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,24 @@ 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.
- name: Get Release Manifest PATH
shell: bash
run: |
export MANIFEST_PATHNAME=$(ls alire/releases/*.toml | head -n 1)
echo MANIFEST_PATHNAME=$MANIFEST_PATHNAME >> $GITHUB_ENV
Expand Down

0 comments on commit ffaf2d4

Please sign in to comment.