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

Use tag name or release url as input #4

Open
fraciril opened this issue Jan 21, 2021 · 3 comments
Open

Use tag name or release url as input #4

fraciril opened this issue Jan 21, 2021 · 3 comments

Comments

@fraciril
Copy link

Hi! I've been using this Github Action and I run into an issue:

The release must use ${{ github.ref }} as its tag:

const tagName = this.context.ref;

This may not be a great idea, as seen here: actions/create-release#116.

I think there should be an option to specify either the tag name or the release url, like https://github.com/actions/upload-release-asset does. This would both avoid the mentioned issue and let the users pick their desired release tags.
Thank you!

@alexellis
Copy link
Owner

Help me understand your workflow.

How do you tend to create your releases? I do it by creating a release in the GitHub UI.

@tillkruss
Copy link

I ran into this as well when using workflow_dispatch. Having the repository and tag name as optional inputs would be useful.

@psarras
Copy link

psarras commented Sep 3, 2021

Hey, I want to add the assets using this action but on a specific release that I create on the fly.
@alexellis if it helps I am currently creating the release whenever a PR goes through to the release branch like so:

      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: build-number-${{ env.BUILD_NUMBER }}
          release_name: ${{env.BUILD_NUMBER}} Release
          draft: false
          prerelease: false

I used to then do this using the deprecated now plugin

      - name: Upload Release Asset 1
        id: upload-release-asset 
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps 
          asset_path: something.3dm
          asset_name: something.3dm
          asset_content_type: application/zip

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

4 participants