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

Release notes fail to generate when used from a reusable workflow #337

Closed
herebebeasties opened this issue Mar 20, 2023 · 3 comments
Closed

Comments

@herebebeasties
Copy link

GitHub has reusable workflow support:
https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow

However if you embed this action in a reusable workflow, the release notes step does not work:

👩‍🏭 Creating new GitHub release for tag v1.0.0...
🤔  not include valid file.

The reusable workflow has:

      - name: Release
        uses: softprops/action-gh-release@v1
        if: ${{ success() && startsWith(github.ref, 'refs/tags/v') }}
        with:
          generate_release_notes: true
@adam-grant-hendry
Copy link

The same issue occurs for tags. Reused workflows don't see generated tags (i.e. git describe --tags fails): workflow run.

image

@adam-grant-hendry
Copy link

adam-grant-hendry commented Oct 16, 2023

The same issue occurs for tags. Reused workflows don't see generated tags

Actually, this looks like it was due to the fetch-depth of actions/checkout. Once I used:

- name: Checkout
   uses: actions/checkout@v4
   with:
     # See: https://github.com/actions/checkout/issues/206
     # See: https://github.com/actions/checkout/issues/1471
     fetch-depth: 0
     fetch-tags: true

it worked.

@herebebeasties Since your step checks for tags (startsWith(github.ref, 'refs/tags/v')), do you checkout tags? By default, actions/checkout uses fetch-depth: 1 and doesn't check out tags.

Unfortunately, the fetch-tags option doesn't currently work by itself (see actions/checkout #1471), so you have to use fetch-depth: 0 and fetch-tags or possibly running git fetch --prune --unshallow --tags prior to your Release step (see actions/checkout #206).

@herebebeasties
Copy link
Author

Ah ha! I was indeed missing the fetch-tags (I had the fetch-depth already). 🙄
Adding that fixes it. Thank you!

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

2 participants