Skip to content

Add frontmatter example to role check error message#10032

Merged
pelikhan merged 3 commits intomainfrom
copilot/update-role-check-message
Jan 15, 2026
Merged

Add frontmatter example to role check error message#10032
pelikhan merged 3 commits intomainfrom
copilot/update-role-check-message

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

When workflows fail permission checks, users receive an error message but no guidance on how to fix it in the workflow frontmatter.

Changes

  • Enhanced error message in check_membership.cjs: Added inline example showing how to configure the roles field in frontmatter with the user's actual permission level
  • Updated test expectations: Modified test to validate the new message format includes the example

Example

Before:

Access denied: User 'contributor' is not authorized. Required permissions: admin, write

After:

Access denied: User 'contributor' is not authorized. Required permissions: admin, write. 
To allow this user to run the workflow, add their role to the frontmatter. 
Example: roles: [admin, write, read]

The example dynamically includes the user's actual permission level (read in this case) alongside the currently required permissions, making it immediately actionable.

Original prompt

Update the role check message in JavaScript (when a workflow does not run because role is not supported), to provide an example on how to fix the issue in the front matter


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

Copilot AI and others added 2 commits January 15, 2026 06:16
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update role check message to include fix example Add frontmatter example to role check error message Jan 15, 2026
Copilot AI requested a review from pelikhan January 15, 2026 06:28
@pelikhan pelikhan marked this pull request as ready for review January 15, 2026 06:30
@pelikhan pelikhan merged commit 8a9954e into main Jan 15, 2026
@pelikhan pelikhan deleted the copilot/update-role-check-message branch January 15, 2026 06:30
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

Successfully merging this pull request may close these issues.

2 participants