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

[{"resource":"Release","code":"already_exists","field":"tag_name"}] #375

Open
AlbertXiaoPeng opened this issue Jul 26, 2023 · 1 comment

Comments

@AlbertXiaoPeng
Copy link

My workflow.yml

name: REALEASE

on:
  push:
    tags:
      - "v*.*.*"

permissions:
  contents: write
  discussions: write

jobs:
  build:
    runs-on: ubuntu-latest
    name: production deploy
    steps:
      - uses: actions/checkout@v3
      - uses: pnpm/action-setup@v2
        with:
          version: 8
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
        env:
          CI: true
          PROGRESS: none
          NODE_ENV: test
          NODE_OPTIONS: --max_old_space_size=4096
      - name: pnpm install
        run: |
          echo ${{github.ref}}
          pnpm install
      - name: Build
        run: |
          echo ${{github.workspace}}
          pnpm build
      - name: Compress action step
        uses: a7ul/tar-action@v1.1.0
        id: compress
        with:
          command: c
          cwd: ./
          files: |
            ./apps/tools-site/dist
          outPath: tools-site.tar.gz
      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          token: ${{secrets.CUSTOM_TOKEN}}
          name: ${{github.ref_name}}
          tag_name: ${{github.ref_name}}
          body_path: ./apps/tools-site/changelogs/${{github.ref_name}}.md
          discussion_category_name: Release
          files: tools-site.tar.gz

When I push a new tag, it starts to run the workflow, but it gives an error

👩‍🏭 Creating new GitHub release for tag v2.0.3...
⚠️ GitHub release failed with status: 404
undefined
retrying... (2 retries remaining)
👩‍🏭 Creating new GitHub release for tag v2.0.3...
⚠️ GitHub release failed with status: 4[22](https://github.com/xp-work/Test2/actions/runs/5655268949/job/15320028840#step:8:23)
[{"resource":"Release","code":"already_exists","field":"tag_name"}]
retrying... (1 retries remaining)
👩‍🏭 Creating new GitHub release for tag v2.0.3...
⚠️ GitHub release failed with status: 422
[{"resource":"Release","code":"already_exists","field":"tag_name"}]
retrying... (0 retries remaining)
❌ Too many retries. Aborting...
Error: Too many retries.

When I went to check Release, I found a new release, indicating that the release was successful, but an error was reported in the workflow

image

Please tell me how to handle de-posting from an already existing tag without getting an error?

Or whether it should be added to the publishing process to determine whether the tag exists before deciding on the following actions

@multani
Copy link

multani commented Nov 5, 2023

@AlbertXiaoPeng not sure if you find the problem. If not, can you check if you have the Discussions enabled in your repository and that the discussion_category_name name you use (Release in your example) is a valid category?

As mentioned in #110 (comment), the 404 when creating a release seems to be coming from the an invalid discussion category.

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

2 participants