Skip to content

fix(ai-policy): do not fail fork pull requests on the labelling step - #815

Merged
nickvergessen merged 1 commit into
nextcloud:masterfrom
MiMoHo:ci/ai-policy-label-fork-prs
Oct 16, 2026
Merged

nickvergessen merged 1 commit into
nextcloud:masterfrom
MiMoHo:ci/ai-policy-label-fork-prs

Conversation

@MiMoHo

@MiMoHo MiMoHo commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #767

The AI Policy check fails on fork PRs whose commits carry an Assisted-by trailer, which means it fails the PRs that follow the policy. The cause is the labelling step: runs from forks only get a read-only token and no secrets, so adding the "AI assisted" label returns HTTP 403. The step right before it already ignores that error with || true. #798 reported the same problem and was closed as a duplicate of #767.

This marks the labelling step as continue-on-error, as suggested in #798. The check for a coding-agent Signed-off-by still fails the job, and the label keeps working for PRs from branches in this repository. Fork PRs don't get the label today either, because the step fails, so nothing is lost. The fallback to github.token was added for these runs, and this finishes that work.

#767 suggests moving the label to a pull_request_target workflow. I left that out because zizmor (@zizmorcore), which runs in lint-yaml here, reports pull_request_target as a dangerous trigger, and GitHub Security Lab warns against combining it with untrusted PR code. #799 and #814 just moved the Dependabot and Renovate workflows away from pull_request_target for the same reason, and no workflow in this repository uses it any more. If the label is needed on fork PRs, a separate workflow_run job as described by GitHub Security Lab would be the safer way.

This PR should test itself: it comes from a fork and its commit has an AI-Assisted-By trailer. The run will probably need maintainer approval first.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

AI-Assisted-By: Claude Opus 5.5 (xhigh)

The model drafted the change. I checked it against the issue and the workflow. The commit carries the same line as a trailer.

Runs triggered from forks only get a read-only token and no secrets, so
adding the "AI assisted" label fails with HTTP 403. That fails the whole
job for exactly the pull requests that follow the policy and declare AI
use with an Assisted-by trailer. The label step before it already
ignores this error.

Mark the step as continue-on-error. The check for a coding-agent
Signed-off-by still fails the job.

Fixes nextcloud#767

AI-Assisted-By: Claude Opus 5.5 (xhigh)
Signed-off-by: MiMoHo <37556964+MiMoHo@users.noreply.github.com>
@nickvergessen
nickvergessen merged commit bbe630e into nextcloud:master Oct 16, 2026
6 checks passed
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.

AI workflow fails on forks

2 participants