Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/autopilot-org-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
timeout-minutes: 15
env:
ORG: ${{ vars.ORG }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.ORG_AUTOPILOT_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Grant workflow write to the installer token

When ORG_AUTOPILOT_TOKEN is provisioned with the stated least-privilege set of Contents/Issues/Pull requests write, opt-in installs still fail: this job later copies autopilot-create-issue.yml into .github/workflows/ and pushes that branch, and GitHub documents that classic tokens need the workflow scope while fine-grained/App tokens need Workflows(write) to modify files in .github/workflows (https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents). Please include or validate that permission in this token contract, otherwise the new token can pass the fail-fast check but fail at the install push.

Useful? React with 👍 / 👎.

steps:
- name: Checkout installer
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
Expand All @@ -28,6 +28,10 @@ jobs:
echo "ORG var is required."
exit 1
fi
if [ -z "${GH_TOKEN}" ]; then
echo "ORG_AUTOPILOT_TOKEN is required for cross-repository mutations."
exit 1
fi

template_path=".github/workflows/autopilot-create-issue.yml"
if [ ! -f "${template_path}" ]; then
Expand Down