nextcloud / nextcloud/.github

AI workflow fails on forks

Open
#767 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
No language data
Stars
24
Forks
11
Avg merge
13h 22m
Merged PRs (30d)
15

Description

The AI Policy workflow (ai-policy.yml, check-ai-trailers job) fails on fork PRs when trying to apply the "AI assisted" label (ex: https://github.com/nextcloud/server#60070).

It 403s on both the label-create and label-assign calls because GitHub forces a read-only token (and withholds secrets) for pull_request-triggered runs from forks. The job's issues: write permissions and COMMAND_BOT_PAT fallback don't help.

The labeling step also has no || true, so it hard-fails the whole job, including the real policy check; even when there's no actual violation.

Suggestion: split workflow into two. Keep detection/policy-failing logic on pull_request (read-only), move the label-writing step to a separate pull_request_target-triggered job/workflow.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with .github/workflows/ai-policy.yml and the check-ai-trailers job. Review the policy detection and labeling steps, then test the workflow behavior on a pull request from a fork, focusing on the read-only token and withheld secrets. Done means policy failures still work while label-writing no longer causes fork PR checks to fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.