Skip to content

Conversation

Copy link

Copilot AI commented Jan 6, 2026

The workflow was failing with HTTP 403 when creating releases because it referenced ${{ github.TOKEN }} instead of ${{ secrets.GITHUB_TOKEN }}.

Changes

  • Token references: Updated deployRelease and deployTest jobs to use ${{ secrets.GITHUB_TOKEN }}
  • Permissions: Added workflow-level contents: write permission required for release creation
permissions:
  contents: write

# In both deployment jobs:
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original prompt

Problem

The GitHub Actions workflow is failing with a 403 error when trying to create releases:

HTTP 403: Resource not accessible by integration (https://api.github.com/repos/Codeuctivity/SkiaSharp.Compare/releases)

This occurs in both the deployRelease and deployTest jobs when executing the gh release create command.

Root Cause

The workflow is using ${{ github.TOKEN }} (line 89 and 127 in .github/workflows/dotnet.yml) which doesn't have sufficient permissions to create releases. The correct token should be ${{ secrets.GITHUB_TOKEN }}.

Solution

Update the .github/workflows/dotnet.yml file to fix the token reference in both deployment jobs:

  1. Line 89 in the deployRelease job - change from:

    GITHUB_TOKEN: ${{ github.TOKEN }}

    to:

    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  2. Line 127 in the deployTest job - change from:

    GITHUB_TOKEN: ${{ github.TOKEN }}

    to:

    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Additionally, ensure the workflow has proper permissions by adding a permissions block to both jobs or at the workflow level to grant contents: write permission for creating releases.

Expected Outcome

After this change, the workflow will be able to successfully create GitHub releases using the properly scoped token.

Reference

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@stesee stesee marked this pull request as ready for review January 6, 2026 11:16
Copilot AI review requested due to automatic review settings January 6, 2026 11:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Co-authored-by: stesee <168659+stesee@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GitHub Actions token for release creation Fix GitHub Actions release creation failures due to incorrect token reference Jan 6, 2026
Copilot AI requested a review from stesee January 6, 2026 11:19
@stesee stesee merged commit bc915dc into main Jan 6, 2026
13 of 16 checks passed
@stesee stesee deleted the copilot/fix-github-actions-token branch January 6, 2026 14:20
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants