Git tag condition not working on Github Actions

Viewed 919

I want to use action-gh-release on my github action, and my .yml is like:

...

release:
  needs: assemble
  if: startsWith(github.ref, 'refs/tags/v')
  runs-on: ubuntu-latest

  steps:
  - uses: actions/checkout@v2
  - uses: actions/download-artifact@v2
    with:
      name: my-target
      path: target/
  - name: Release
    uses: softprops/action-gh-release@v1
    with:
      files: target/*.jar
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

And assemble step is success, I use Intellij to add git tag and push, and I check diff enter image description here

And I use echo to check github.ref, and I got:

enter image description here

And release step is skipped enter image description here

And no tag build enter image description here

Is my .yml have some wrong? Or I need to use different IDE to push tag?

0 Answers
Related