question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GitHub Releases requires a tag

See original GitHub issue

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 }}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:23
  • Comments:23 (1 by maintainers)

github_iconTop GitHub Comments

27reactions
windowsaircommented, Apr 9, 2022

In fact, as @softprops said, you need a tag to create a release.

Regarding what @Septias said, it still doesn’t work after adding the tag, I think it may be that the tag is not pushed to github, for more discussion on this see: Push git commits & tags simultaneously


This issue is basically related to tag_name, and here are a few ways to solve the problem.

  1. Set your action to trigger only when it contains a tag
  2. Specify a tag explicitly

The following example specifies a tag named “test”:

    - name: Release user files
      uses: softprops/action-gh-release@v1
      with:
        tag_name: test
        files: |
          file1
          file2

image

Specifying a tag for each commit is annoying. As in the example given by @roslovets, you can use version number control for the tag.

Another example is to specify a tag name for each nightly build version:

    - name: Generate release tag
      id: tag
      run: |
        echo "::set-output name=release_tag::UserBuild_$(date +"%Y.%m.%d_%H-%M")"
    - name: Release user firmware
      uses: softprops/action-gh-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: ${{ steps.tag.outputs.release_tag }}
        files: |
          file1
          file2

image

Ahh, you may be wondering why we don’t generate times like 08:11? I would like to remind you that the character : is not legal in the git tag.

15reactions
roslovetscommented, May 12, 2021

@roslovets If you did, please mention the name here to help others out. Thank you.

I use ncipollo/release-action to create release just after tagging in the same workflow. Example

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are GitHub Releases and How to create a ... - Tools QA
To view, open the tags list in GitHub (Refer Tags In GitHub). Moreover, the option to create a release will be available to...
Read more >
Use GitHub Actions to create a tag but not a release
Another option is to use GitHub Script. This creates a lightweight tag called <tagname> (replace this with the name of your tag):
Read more >
GitHub Releases Uploading - Travis CI Docs
Deploying only on tagged builds · Regular releases · Draft releases with draft: true · Setting the tag at deployment time · Overwrite...
Read more >
GitHubRelease@1 - GitHub Release v1 task - Microsoft Learn
#changeLogCompareToReleaseTag: # string. Required when changeLogCompareToRelease = lastNonDraftReleaseByTag. Release Tag. changeLogType: 'commitBased' # ' ...
Read more >
GitHub—tags and releases | PracticalSeries: Brackets-Git and ...
If we added a release note it would become an annotated tag. A release on the other hand is a GitHub object, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found