Skip to content

ci: skip the jobs dependabot's token can't run - #235

Open
NickJosevski wants to merge 1 commit into
mainfrom
ci/dependabot-job-guards
Open

ci: skip the jobs dependabot's token can't run#235
NickJosevski wants to merge 1 commit into
mainfrom
ci/dependabot-job-guards

Conversation

@NickJosevski

Copy link
Copy Markdown
Contributor

Every dependabot PR currently shows two red checks that have nothing to do with the bump — #222, #224 and #225 all build green and pass e2e, then fail these two.

validate-pr-titleResource not accessible by integration

The action validates the title from the event payload and then labels the PR from it. Dependabot PRs (like fork PRs) run with a read-only token, so the label call fails after the title has already validated.

Reading the action at the pinned SHA, applyLabel returns before it constructs its Octokit client:

async function applyLabel(pr, commitDetail) {
    const addLabel = getInput('add_label');
    if (addLabel !== undefined && addLabel.toLowerCase() === 'false') {
        return;
    }

so add_label: false keeps the title check (checkConventionalCommits, checkScope, checkTextMatches — all payload-only, no API) and drops only the write. The condition covers fork PRs too, since they get the same read-only token.

Publish to OctopusThe Octopus instance URL is required

The job log says Secret source: Dependabot, and that store holds neither OCTOPUS_SERVER nor vars.OCTOPUS_SERVICE_ACCOUNT, so OctopusDeploy/login has nothing to log in with. An actions bump produces no plugin change worth publishing, so the job is skipped rather than handed a copy of the secrets.

Not touched

Build and Package, End-to-end tests, Analyze (java) and CodeQL already pass on dependabot PRs, so their conditions are unchanged. The existing release-please condition on publish is preserved and now &&-ed with the actor check.

🤖 Generated with Claude Code

Every dependabot PR shows two red checks that have nothing to do with the bump:

`validate-pr-title` fails with `Resource not accessible by integration`. The action
labels the PR from the parsed title, and dependabot (like any fork) runs with a
read-only token, so the label API call fails after the title has already validated.
`add_label: false` returns before the action creates its Octokit client, so the check
still validates the title - it just stops trying to write. Fork PRs get the same
read-only token, so they're covered by the same condition.

`Publish to Octopus` fails with `The Octopus instance URL is required`. The job runs
with `Secret source: Dependabot`, which holds neither `OCTOPUS_SERVER` nor
`vars.OCTOPUS_SERVICE_ACCOUNT`, so the login step has nothing to log in with. An
actions bump produces no plugin change worth publishing, so the job is skipped
rather than handed a copy of the secrets.

`Build and Package`, `End-to-end tests` and CodeQL already pass on dependabot PRs and
are left alone.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant