Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

fix(ci): remove job-level permissions conflicting with reusable workflow call - #49

Merged
benhigham merged 3 commits into
mainfrom
fix/release-workflow-permissions
Mar 11, 2026
Merged

fix(ci): remove job-level permissions conflicting with reusable workflow call#49
benhigham merged 3 commits into
mainfrom
fix/release-workflow-permissions

Conversation

@benhigham

@benhigham benhigham commented Mar 11, 2026

Copy link
Copy Markdown
Owner

Problem

The Release workflow has been failing since 2026-03-05 with "This run likely failed because of a workflow file issue."

Root cause: GitHub Actions does not allow jobs.<id>.permissions and jobs.<id>.uses on the same job. Both were set — the permissions block was redundant because release-changesets.yml (the reusable workflow) already declares its own internal permissions.

Fix

  • Move the job-level permissions to the workflow level. The reusable workflow's job-level permissions can only use permissions that the caller grants (same or more restrictive), so the caller must provide them at the workflow level.
  • Remove issues: write — confirmed not needed after auditing all octokit API calls in changesets/action source (repos.createRelease, pulls.list, pulls.create, pulls.update — zero issues API usage).
  • Fix comment accuracy: attribute attestations: write and id-token: write to npm provenance (not changesets/action), correct "verification" to "generation", and note that pull-requests: write covers both create and update.

Impact

Unblocks the release of v0.2.0, which has been on main (changeset merged, package.json bumped) but unpublished since 2026-03-06.

…low call

GitHub does not allow jobs.<id>.permissions and jobs.<id>.uses together.
The reusable workflow (release-changesets.yml) declares its own permissions
internally. Removing the redundant job-level block unblocks the release workflow.
Copilot AI review requested due to automatic review settings March 11, 2026 00:09
@changeset-bot

changeset-bot Bot commented Mar 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 73d6564

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes the failing Release GitHub Actions workflow by removing an invalid job configuration (calling a reusable workflow while also defining job-level permissions).

Changes:

  • Removes jobs.release.permissions from .github/workflows/release.yml to avoid the permissions + uses conflict on the same job.

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

Comment on lines 17 to 20
release:
if: github.event.workflow_run.conclusion == 'success'
name: Release
permissions:
attestations: write # to create attestations (changesets/action)
contents: write # to create the release (changesets/action)
id-token: write # for npm provenance verification (changesets/action)
issues: write # to post issue comments (changesets/action)
pull-requests: write # to create the pull request (changesets/action)
uses: benhigham/.github/.github/workflows/release-changesets.yml@main

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

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

With the job-level permissions removed, this workflow now relies on the workflow-level permissions: {} (line 14), which sets the caller’s GITHUB_TOKEN permissions to none. For reusable workflows, the called workflow’s token permissions are constrained by the caller, so release-changesets.yml may not be able to perform actions like creating releases/PRs or posting comments. Consider setting the required permissions at the workflow level here (since job-level permissions can’t be used with jobs.<id>.uses), or remove/relax permissions: {} if you intend the called workflow to control permissions.

Copilot uses AI. Check for mistakes.
@benhigham

Copy link
Copy Markdown
Owner Author

Fixed — moved permissions to workflow level. Reusable workflows inherit the calling workflow's permissions, so permissions: {} at workflow level was zeroing out the token. Permissions are now declared at the top of the workflow file instead.

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