Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it seems like release are always created from the default branch #392

Open
jacquesvdm7 opened this issue Oct 18, 2023 · 2 comments
Open

Comments

@jacquesvdm7
Copy link

This is the extract from the script to create the release and when I check the release notes generated it's obvious that it's for the master branch and not for the PRODUCTION branch that triggered the workflow. Is this a bug or by design?

  - name: Release
    id: create_release
    uses: softprops/action-gh-release@v1

if: startsWith(github.ref, 'refs/tags/')

    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN  }}
    with:
      name: ${{ github.event.inputs.releaseName }}
      tag_name: ${{ github.event.inputs.releaseTag }}
      generate_release_notes: ${{ env.GENERATE_RELEASE_NOTES }}
      files: |
        ${{ github.workspace }}/${{ env.BUILD_TARGET_PATH }}/${{ env.WEBAPP_NAME }}.jar
        ${{ github.workspace }}/${{ env.BUILD_TARGET_PATH }}/${{ env.WEBAPP_NAME }}.zip
@backwardsEric
Copy link

According to the readme, it is by design. In the section about optional keys for "with" the readme says: "target_committish - Commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Defaults to repository default branch."

Inserting

      target_commitish: {{ github.sha }}

before the "files: |" line near the end of your workflow should give you the behavior you want.

@hahn-kev
Copy link

hahn-kev commented Mar 6, 2024

we were just caught out by this, seems strange that it wouldn't default to targeting the commit that triggered the action to execute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants