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

Does not work when using ${{ github.ref }} as input.tag #1

Closed
BadIdeaException opened this issue Apr 3, 2022 · 0 comments · Fixed by #2
Closed

Does not work when using ${{ github.ref }} as input.tag #1

BadIdeaException opened this issue Apr 3, 2022 · 0 comments · Fixed by #2

Comments

@BadIdeaException
Copy link
Contributor

The following step definition makes the script exit with code 1 on a tag push:

on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    tags: 
      - 'v*'

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - uses: nebula-actions/[email protected]
              with:
                  asset-path: whatever
                  tag: ${{ github.ref }}

This is because github.ref includes the prefix refs/tags/, so your GH_RELEASE variable becomes:

https://api.github.com/repos/{author}/{repo}/releases/tags/refs/tags/{tag}

But the correct URL as per the GitHub API docs should be

https://api.github.com/repos/{owner}/{repo}/releases/tags/{tag}
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

Successfully merging a pull request may close this issue.

1 participant