Skip to content

GitHub Releases requires a tag #20

@preetjdp

Description

@preetjdp

I keep getting this error that my git tag has not been set, tried multiple ways to do that from the command line and from bash inside of the action. Could not get promising results hence this issue.

Here is my main.yaml

name: Fast Builds

on: [push]

jobs:
build:

  runs-on: ubuntu-latest
  
  steps:
  - uses: actions/checkout@v1
  - uses: actions/setup-java@v1
    with:
      java-version: '12.x'
  - uses: subosito/flutter-action@v1
    with:
      channel: 'stable'      
  - run: flutter doctor
  - run: flutter pub get
  - run: flutter build apk
  - name: Display the path
    run: |
      echo ${PATH}
      git tag 0.0.1
      echo "wow"
    shell: bash
#     -name: Debug Info
#      shell: bash
#      run: |
#         GITHUB_TAG = "0.0.1"
#         git tag ${GITHUB_TAG}
#         echo "Release Tag :   ${GITHUB_TAG}"
  - name: Release To Git
    uses: softprops/action-gh-release@v1
#       if: startsWith(github.ref, 'refs/tags/')
    with: 
      body: "A new release"
      files: build/app/outputs/apk/release/app-release.apk
    env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Activity

softprops

softprops commented on Sep 20, 2019

@softprops
Owner

A few things to note

  1. this action required a tag because GitHub releases do. That is not a bug.

  2. The push event that triggers the workflow run needs to be the push associated with a git push origin {tag}. The reason being that GitHub releases can only be created if GitHub servers know about the associated tag.

It looks like the push that is triggering these runs is a push of a commit.

  1. the tag operation within the workflow only exists in the workflow run checkout, not on your GitHub origin remote. If you push this within your workflow run it should trigger another run where the push is for your tag

  2. environment variables export within a step are not by default exposed to future steps. This is because every step runs in its own process.

You can use a custom command to pass env variables between workflow steps


I will try and follow up on this with documentation on a strategy for creating tags within a workflow run

Amet13

Amet13 commented on Sep 21, 2019

@Amet13

I'm also struggled with that problem, trying to fix it somehow.
Is there any hack on how to create tag automatically after creating and publishing release?
Or maybe some option to ignore tag checking (as it worked before)?

skirpichev

skirpichev commented on Oct 13, 2019

@skirpichev

I notice same error in https://github.com/diofant/diofant/commit/6740f83761a14a06f44ab0b1d001907f70bcba0e/checks?check_suite_id=262644565
This build was initially triggered by tag push, but was unsuccessful due one of slow tests and then - was restarted.

Alkrun

Alkrun commented on Jan 8, 2020

@Alkrun

I'm using gitversion for versioning, which handles versioning based on branches... It doesn't work when checking out a tag instead of a branch so I can't use a github workflow triggered by a pushed tag.

I've currently got the following steps:

    - name: Tag
      if: startsWith(github.ref, 'refs/heads/release/')
      run: |
        git tag "v$env:GitVersion_SemVer"
        git push origin "v$env:GitVersion_SemVer"
    - name: Release
      if: startsWith(github.ref, 'refs/heads/release/')
      uses: softprops/action-gh-release@v1
      with:
        name: v${{ env.GitVersion_SemVer }}
        prerelease: ${{ env.GitVersion_PreReleaseLabel != '' }}
        files: ./artifacts/sidekick-*.zip
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Couldn't action-gh-release create the release based on the name I'm providing? What additional information does it need that requires this be a pushed tag that triggered the build?

bc3tech

bc3tech commented on Mar 7, 2021

@bc3tech

+1 to this confusion; see no reason that I can't specify a tag name and this Action tags & releases all in one go.

proddy

proddy commented on Mar 7, 2021

@proddy

+1 same here

roslovets

roslovets commented on Mar 31, 2021

@roslovets

+1

rcdailey

rcdailey commented on Apr 13, 2021

@rcdailey

Is this still an issue? I'm triggering release process based on a pull request merge for branches prefixed with release/. I will want to create a tag AND github release in this workflow.

If @softprops is inactive I may look elsewhere. It's unfortunate because it's hard to find an action that will also allow you to upload artifacts.

Septias

Septias commented on Apr 24, 2021

@Septias

image
Well I added a tag and still got that error :/

git tag 1.1.1
git push origin master 1.1.1
zapjelly

zapjelly commented on May 12, 2021

@zapjelly

anyone managed to get passed this? example would be appreciated.

roslovets

roslovets commented on May 12, 2021

@roslovets

I swithed to another action that does it easy.

proddy

proddy commented on May 12, 2021

@proddy

I swithed to another action that does it easy.

same here

23 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @softprops@kthy@superg@proddy@rcdailey

      Issue actions

        GitHub Releases requires a tag · Issue #20 · softprops/action-gh-release