Skip to content

Suggest lock exclusion for workflow permission push failures - #72423

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan/verbose-adventure
Oct 27, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan/verbose-adventure

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

GitHub rejects pushes containing workflow YAML when the token lacks workflow-write permission, but the error does not explain how to omit generated workflow locks from safe outputs.

Detects GitHub's workflow-permission rejection in shared JavaScript push handling and appends guidance to set exclude-lock-yml: true on the relevant safe-outputs entry. The original rejection is preserved, and the hint clarifies that other workflow YAML changes still require authorized credentials. Covers direct pushes and signed-push failure paths without changing credentials or retry behavior.

Adds regression coverage for GitHub App, PAT, and OAuth rejections, unrelated failures, and signed-push fallback behavior, plus documentation of the diagnostic.

Validation

  • make fmt-cjs && make lint-cjs
  • cd actions/setup/js && npx vitest run push_signed_commits.test.cjs (89 tests passed)
  • make agent-report-progress
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 27, 2026 14:29
Copilot AI max review requested due to automatic review settings October 27, 2026 14:29
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · haiku45 · ~6 AIC · ⌖ ~9 AIC · ◇ ~3 AIC · ⊞ 8.9K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · opus55 · ~11 AIC · ⌖ ~38 AIC · ◇ ~3 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · gpt56 · ~9 AIC · ⌖ ~6 AIC · ⊞ 14.8K · ◷

Generated by Ponytail Reviewer for #72423

@github-actions github-actions Bot 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.

Review: no blocking findings

The workflow-permission diagnostic is narrowly matched, preserves the original error, and is covered for direct and signed-push fallback paths. I found no actionable correctness, security, or performance issue in the changed lines.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

@pelikhan
pelikhan merged commit fb98d34 into main Oct 27, 2026
84 checks passed
@pelikhan
pelikhan deleted the pelikhan/verbose-adventure branch October 27, 2026 14:43

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.

🟡 Changes recommended

The shared helper incorrectly recommends exclude-lock-yml for maintenance pushes without safe outputs, where missing workflow-write permissions instead require appropriately authorized credentials.

1 open issue
What changed in this PR

Adds workflow-permission diagnostics to gh-aw’s shared push handling, helping safe-output users identify when generated workflow locks can be excluded.

Changes:

  • Suggests exclude-lock-yml: true for matching GitHub rejections while preserving the original error.
  • Covers direct and signed-push failure paths without changing credentials or retry behavior.
  • Adds regression tests and documents the diagnostic.
File Description
docs/​src/​content/​docs/​reference/​safe-outputs-pull-requests.md Documents the permission hint and its limits.
actions/​setup/​js/​push_signed_commits.test.cjs Tests token rejection variants, unrelated failures, and fallback behavior.
actions/​setup/​js/​push_signed_commits.cjs Detects workflow-permission rejections and appends guidance.

Review effort: Max

Comment on lines +58 to +61
"If these changes are generated workflow locks, set `exclude-lock-yml: true` on the relevant `safe-outputs` entry " +
"(for example, `safe-outputs.create-pull-request` or `safe-outputs.push-to-pull-request-branch`) and recompile the workflow. " +
"Other workflow YAML changes still require credentials permitted to update workflows. " +
"Regenerate and commit excluded locks with authorized credentials before merging."
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants