action-gh-release icon indicating copy to clipboard operation
action-gh-release copied to clipboard

GitHub error 403 undefined

Open CryZe opened this issue 1 year ago • 8 comments

I'm getting the following error:

👩‍🏭 Creating new GitHub release for tag latest...
⚠️ GitHub release failed with status: 403
undefined
retrying... (2 retries remaining)
👩‍🏭 Creating new GitHub release for tag latest...
⚠️ GitHub release failed with status: 403
undefined
retrying... (1 retries remaining)
👩‍🏭 Creating new GitHub release for tag latest...
⚠️ GitHub release failed with status: 403
undefined
retrying... (0 retries remaining)
❌ Too many retries. Aborting...
Error: Too many retries.

https://github.com/CryZe/game-maker-auto-splitter/actions/runs/7301685228/job/19899026066#step:5:10

This is how I invoke the action:

      - name: Release
        if: github.ref == 'refs/heads/master'
        uses: softprops/action-gh-release@v1
        with:
          files: target/wasm32-unknown-unknown/release/game_maker_auto_splitter.wasm
          name: Latest
          tag_name: latest
          body: This contains the latest version of the auto splitter.

CryZe avatar Dec 22 '23 16:12 CryZe

Same error :(

estebanfern avatar Dec 22 '23 23:12 estebanfern

Same here: image

StefH avatar Dec 25 '23 10:12 StefH

Here is one solution. Or look into one of the other open 403 Error issues in this repo.

christianll9 avatar Dec 25 '23 16:12 christianll9

Hey, i found the solution. In the repository settings, go to Actions -> General image Allow Read and Write Permissions for Github Workflows and save changes. If your repository is from an organization you will have to do an extra step, go to Organization Settings -> Actions -> General image

estebanfern avatar Dec 27 '23 14:12 estebanfern

You should also be able to specify that in the job with permissions such as

create-release:
    name: Create draft release
    runs-on: ubuntu-latest
    permissions: 
      contents: write
    steps:
      - name: Create Release
        uses: softprops/action-gh-release@v1

# rest of code here

eggsy84 avatar Jan 10 '24 16:01 eggsy84

Both parts are required:

  1. Workflow permissions - suggested by @estebanfern https://github.com/softprops/action-gh-release/issues/400#issuecomment-1870332450

  2. Configuring the permissions at the workflow file permissions: contents: write , suggested by @eggsy84

koss110 avatar Jan 25 '24 10:01 koss110

@koss110 - I don't think you need both - it's more like you need either.

You can enable write permissions for all workflows in a repo or organization via the Settings->Actions->General GUI option.

You can enable write permissions for one workflow via the contents: write permission in the .yaml file.

In the past the default option was read/write, but it changed about a year ago. See this for more details: https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/

drojf avatar Feb 07 '24 10:02 drojf

Can confirm that adding this to YAML is enough:

    permissions:
      contents: write

It is not necessary to manually edit the permissions in the GitHub UI.

ForNeVeR avatar Feb 17 '24 20:02 ForNeVeR