Skip to content

ci: fall back to github.token in the AI policy workflow - #349

Merged
kyteinsky merged 1 commit into
nextcloud:masterfrom
bakiburakogun:fix/ai-policy-fork-token
Sep 1, 2026
Merged

kyteinsky merged 1 commit into
nextcloud:masterfrom
bakiburakogun:fix/ai-policy-fork-token

Conversation

@bakiburakogun

Copy link
Copy Markdown
Contributor

Problem

check-ai-trailers fails on every pull request from a fork, whatever the commits contain. The first step never gets as far as inspecting them:

gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable.
Process completed with exit code 4

Secrets are not exposed to pull_request runs from forks, so secrets.COMMAND_BOT_PAT is empty and gh api exits 4.

Change

Fall back to github.token, which is what the organization template in nextcloud/.github already does:

GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT || github.token }}

nextcloud/spreed already carries the updated version; this copy predates it. The workflow declares the permissions it needs (contents: read, pull-requests: write, issues: write), so the default token can read the commit list.

Noticed because it is the only red check on #343.

Secrets are not exposed to pull requests from forks, so COMMAND_BOT_PAT is
empty there and the first step fails before it checks anything:

    gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN
    environment variable.
    Process completed with exit code 4

check-ai-trailers therefore fails on every PR from a fork, regardless of its
commits. The workflow already requests the permissions it needs, so the default
token can read the commit list.

This is what the organization template in nextcloud/.github already does, and
what nextcloud/spreed carries; this copy predates that change.

Signed-off-by: Baki Burak Öğün <63836730+bakiburakogun@users.noreply.github.com>

@kyteinsky kyteinsky 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.

nice thanks!
although your PRs should have this trailer too :)

@kyteinsky
kyteinsky merged commit ab273bc into nextcloud:master Sep 1, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants