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

GitHub error 403 undefined #400

Open
CryZe opened this issue Dec 22, 2023 · 8 comments
Open

GitHub error 403 undefined #400

CryZe opened this issue Dec 22, 2023 · 8 comments

Comments

@CryZe
Copy link

CryZe commented Dec 22, 2023

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.
@estebanfern
Copy link

Same error :(

@StefH
Copy link

StefH commented Dec 25, 2023

Same here:
image

@christianll9
Copy link

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

@estebanfern
Copy link

estebanfern commented Dec 27, 2023

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

@eggsy84
Copy link

eggsy84 commented Jan 10, 2024

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

DragaDoncila pushed a commit to napari/npe2 that referenced this issue Jan 24, 2024
This pr fixes the bug of 403 error during create github release:

```
Run softprops/action-gh-release@v1
πŸ‘©β€πŸ­ Creating new GitHub release for tag v0.7.4...
⚠️ GitHub release failed with status: 403
undefined
retrying... (2 retries remaining)
πŸ‘©β€πŸ­ Creating new GitHub release for tag v0.7.4...
⚠️ GitHub release failed with status: 403
undefined
retrying... (1 retries remaining)
πŸ‘©β€πŸ­ Creating new GitHub release for tag v0.7.4...
⚠️ GitHub release failed with status: 403
undefined
retrying... (0 retries remaining)
❌ Too many retries. Aborting...
Error: Too many retries.
```


softprops/action-gh-release#400 (comment)

I have added also `id-token: write` because this is set of permissions
that we have in the main repository.
@koss110
Copy link

koss110 commented Jan 25, 2024

Both parts are required:

  1. Workflow permissions - suggested by @estebanfern
    GitHub error 403 undefinedΒ #400 (comment)

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

@drojf
Copy link

drojf commented Feb 7, 2024

@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/

@ForNeVeR
Copy link

ForNeVeR commented Feb 17, 2024

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.

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

8 participants