Skip to content

Fix: add allowed-files to safe-outputs for node and github-actions workflows#1071

Merged
dgee2 merged 3 commits into
mainfrom
fix/safe-outputs-allowed-files
May 23, 2026
Merged

Fix: add allowed-files to safe-outputs for node and github-actions workflows#1071
dgee2 merged 3 commits into
mainfrom
fix/safe-outputs-allowed-files

Conversation

@dgee2

@dgee2 dgee2 commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

The node and github-actions dependency-update workflows fail at the safe-outputs step with:

Cannot create pull request: patch modifies protected files (...). Add them to the allowed-files configuration field

The safe-outputs system has a built-in protected-files list that blocks PRs touching sensitive files. These need to be explicitly allowlisted since modifying them is the purpose of each workflow.

Root cause

  • Node workflow: package.json and pnpm-lock.yaml are protected by default
  • GitHub Actions workflow: .github/workflows/*.yml files are protected by default

Fix

Added allowed-files to safe-outputs.create-pull-request in each source file:

  • dependency-update-node.md: **/package.json, **/pnpm-lock.yaml, **/package-lock.json, **/yarn.lock, **/.npmrc
  • dependency-update-github-actions.md: .github/workflows/*.yml, .github/workflows/*.yaml, .github/actions/**/*.yml, .github/actions/**/*.yaml

Note

The dotnet workflow (which passed) doesn't need this fix because .csproj, Directory.Packages.props etc. are not in the default protected-files list.

dgee2 and others added 3 commits May 23, 2026 23:06
The repository has no COPILOT_TOKEN secret. gh-aw looks for
COPILOT_GITHUB_TOKEN by default so the engine.env mapping was
unnecessary. Removing it also removes the need for --approve on compile.

Requires a COPILOT_GITHUB_TOKEN repository secret to be created:
a fine-grained PAT with the 'Copilot Requests' permission.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The node and github-actions dependency-update workflows were failing at
the safe-outputs step because package.json / pnpm-lock.yaml and
.github/workflows/*.yml are in safe-outputs' default protected-files
list.

Add explicit allowed-files entries so the agent can create PRs that
modify those files — which is the entire purpose of these workflows.

- dependency-update-node.md: allow **/package.json, **/pnpm-lock.yaml,
  **/package-lock.json, **/yarn.lock, **/.npmrc
- dependency-update-github-actions.md: allow .github/workflows/*.yml/yaml
  and .github/actions/**/*.yml/yaml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 22:28
@dgee2 dgee2 enabled auto-merge (squash) May 23, 2026 22:29
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes Copilot gh-aw dependency-update workflows failing during the Safe Outputs “create pull request” step by explicitly allowlisting the protected files that these workflows are expected to modify.

Changes:

  • Add allowed-files allowlists to safe-outputs.create-pull-request for the Node dependency update workflow.
  • Add allowed-files allowlists to safe-outputs.create-pull-request for the GitHub Actions dependency update workflow.
  • Regenerate the corresponding *.lock.yml compiled workflow files to reflect the updated Safe Outputs configuration.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/dependency-update-node.md Adds allowed-files patterns for Node lockfiles/manifests so Safe Outputs permits intended edits.
.github/workflows/dependency-update-node.lock.yml Compiled lockfile updated to include allowed_files in the generated Safe Outputs config.
.github/workflows/dependency-update-github-actions.md Adds allowed-files patterns for workflow/action YAML updates so Safe Outputs permits intended edits.
.github/workflows/dependency-update-github-actions.lock.yml Compiled lockfile updated to include allowed_files in the generated Safe Outputs config.

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

Comment thread .github/workflows/dependency-update-node.md
@dgee2 dgee2 merged commit 1c1bebc into main May 23, 2026
14 checks passed
@dgee2 dgee2 deleted the fix/safe-outputs-allowed-files branch May 23, 2026 22:34
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