Skip to content

CI: Skip vault secrets and publish-report for fork PRs#2547

Open
sunker wants to merge 2 commits intomainfrom
fix/ci-for-fork-prs
Open

CI: Skip vault secrets and publish-report for fork PRs#2547
sunker wants to merge 2 commits intomainfrom
fix/ci-for-fork-prs

Conversation

@sunker
Copy link
Copy Markdown
Contributor

@sunker sunker commented Mar 30, 2026

What this PR does / why we need it:

Gates vault secret steps, sign-plugin, Docker Hub login and the publish-report job with a fork check so external contributors get green CI.

Which issue(s) this PR fixes:

Fixes the CI failures on #2498.

Special notes for your reviewer: N/A

Fork PRs fail CI because they can't access Grafana's Vault via OIDC
and lack write permissions to push to gh-pages. Gate all vault secret
steps, sign-plugin, Docker login and publish-report with a fork check
so external contributors get green CI on the jobs that can run without
internal secrets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sunker sunker requested review from a team as code owners March 30, 2026 06:20
@sunker sunker added the no-changelog Don't include in changelog and version calculations label Mar 30, 2026
Copilot AI review requested due to automatic review settings March 30, 2026 06:20
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs.

NX_BRANCH: ${{ github.event.number || github.ref_name }}
steps:
- id: get-secrets
if: ${{ github.event.pull_request.head.repo.fork != true }}
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.

is this a github workflow thing or can we write ${{ github.event.pull_request.head.repo.fork == false }} instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

According to Claude, on push events github.event.pull_reques is null, so .head.repo.fork is also null. null != true evaluates to true (step runs), but null == false would be false and skip vault secrets on main. This is kind of hard to verify, but it's describe here: https://github.com/orgs/community/discussions/25645

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the main CI workflow to avoid running secret-dependent steps and report publishing for pull requests coming from forks, so external contributors can get passing CI without access to internal credentials.

Changes:

  • Gate Vault secret retrieval steps behind a fork check.
  • Gate Docker Hub login and sign-plugin usage behind a fork check.
  • Gate the publish-report job behind a fork check.

@grafana-plugins-platform-bot grafana-plugins-platform-bot bot moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team Mar 30, 2026
Keep the existing dependabot[bot] actor check alongside the new fork
check to avoid an unintended behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Don't include in changelog and version calculations

Projects

Status: 🔬 In review

Development

Successfully merging this pull request may close these issues.

3 participants