create-release icon indicating copy to clipboard operation
create-release copied to clipboard

##[error]Validation Failed Why does this error happen?

Open yjcn opened this issue 5 years ago • 4 comments

This my workflow yaml. I think there is no error. But it always fails. Someone can help me ? Thanks. 图片

# on:
#   watch:
#     types: [started]
on: push
name: Upload Release Asset

jobs:
  build:
    name: Upload Release Asset
    runs-on: ubuntu-latest
    steps:
      - uses: uraimo/[email protected]
        id: runcmd
        with:
          architecture: aarch64
          distribution: ubuntu18.04
          run: |
            echo ::set-env name=ARCH::$(uname -m)
            echo ::set-output name=ARCH::$(uname -m)
            echo ::set-env name=TIME::$(date)
            ARCH=$(uname -m)
            echo "arch:::",$ARCH
            echo "123" >> ${ARCH}.zip
            echo `ls`
            echo `pwd`
      - name: test
        run: |
          echo ${TIME}
          echo "456" > ${ARCH}a.zip
          echo `uname -a`
          echo `pwd`
          echo `ls`
          echo ${ARCH}
      - name: Create Release
        id: create_release
        uses: actions/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          ARCH: ${{ env.ARCH }}
        with:
          tag_name: ${{ github.sha }}
          release_name: Release ${{ github.sha }}
          draft: false
          prerelease: false
      - name: Upload Release Asset
        id: upload-release-asset 
        uses: actions/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          ARCH: ${{ env.ARCH }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ${ARCH}.zip
          asset_name: ${ARCH}.zip
          asset_content_type: application/zip

yjcn avatar Feb 09 '20 03:02 yjcn

Update

I figured out my issue. The a release with the same name already existed.

Original issue

I get this too. Relevant yaml:

jobs:
  release:
    runs-on: ubuntu-latest
    name: Release
    steps:
      - name: checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - name: build
        <omitted>
      - name: create release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref }}
          draft: false
          prerelease: false
      - name: upload release asset
        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 }}
          asset_path: ./grax
          asset_name: grax
          asset_content_type: application/octet-stream

Logs:

##[debug]..Evaluating String:
##[debug]..=> 'ref'
##[debug]=> 'refs/tags/v0.1.0'
##[debug]Result: 'refs/tags/v0.1.0'
##[debug]Evaluating: format('Release {0}', github.ref)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> 'Release {0}'
##[debug]..Evaluating Index:
##[debug]....Evaluating github:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'ref'
##[debug]..=> 'refs/tags/v0.1.0'
##[debug]=> 'Release refs/tags/v0.1.0'
##[debug]Result: 'Release refs/tags/v0.1.0'
##[debug]Loading env
Run actions/create-release@v1
  with:
    tag_name: refs/tags/v0.1.0
    release_name: Release refs/tags/v0.1.0
    draft: false
    prerelease: false
  env:
    GITHUB_TOKEN: ***
##[error]Validation Failed
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: create release

nzoschke avatar Feb 13 '20 18:02 nzoschke

Repro: create a release via github.com web-ui. The actions starts because of the tag beeing created behind the scenes. The action tries to create a release with the name the user actualy created just in the step beforehand

staabm avatar Feb 14 '20 20:02 staabm

Duplicate of #2 and sort of #29, #12.

Trass3r avatar Apr 06 '20 13:04 Trass3r

Repro: create a release via github.com web-ui. The actions starts because of the tag beeing created behind the scenes. The action tries to create a release with the name the user actualy created just in the step beforehand @staabm : You are correct

Steps I followed

  1. Pushed changes to the to develop branch
  2. PR Develop to Master
  3. Merged the PR
  4. From CLI triggered the below commands (Note it : NOT from WEB Console)
  • git tag release_tag
  • git push origin release_tag

i.g.

git tag v1.0.15 git push origin v1.0.15

This will solve it.

SurendraKMali avatar Apr 30 '20 09:04 SurendraKMali