Skip to content

ci(github): use app token for dependabot merges#23

Merged
ncipollina merged 2 commits into
mainfrom
ci/dependabot-app-token
Jul 22, 2026
Merged

ci(github): use app token for dependabot merges#23
ncipollina merged 2 commits into
mainfrom
ci/dependabot-app-token

Conversation

@ncipollina

Copy link
Copy Markdown
Contributor

Summary

Updates the Dependabot auto-merge workflow to use the LayeredCraft GitHub App token for approving and enabling auto-merge. This avoids using GITHUB_TOKEN for the merge operation so downstream workflows can run after Dependabot auto-merged changes land on main.

Changes

  • Adds actions/create-github-app-token@v2 to mint an installation token for patch/minor Dependabot PRs.
  • Uses the app token as GH_TOKEN for gh pr review --approve and gh pr merge --auto --squash.
  • Keeps dependabot/fetch-metadata on the default GITHUB_TOKEN.

Validation

  • Reviewed workflow syntax and token usage.
  • No build required; workflow-only change.

Notes for Reviewers

Requires the Actions secrets DEPENDABOT_AUTOMERGE_APP_ID and DEPENDABOT_AUTOMERGE_PRIVATE_KEY to be available to this repository.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c832426140

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/dependabot-auto-merge.yml Outdated
@ncipollina

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 879f700119

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +27 to +28
app-id: ${{ secrets.DEPENDABOT_AUTOMERGE_APP_ID }}
private-key: ${{ secrets.DEPENDABOT_AUTOMERGE_PRIVATE_KEY }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a trigger that can read the app credentials

Because this job only runs for Dependabot PRs under pull_request_target, GitHub's current Dependabot secret rules say those runs do not receive workflow secrets, so these required app-id/private-key inputs will be empty and actions/create-github-app-token fails before the approve/auto-merge steps. Move the app-token work to a Dependabot-supported trigger such as pull_request with Dependabot secrets, or a follow-up workflow_run that has Actions-secret access. See GitHub's secret-type docs: https://docs.github.com/en/code-security/reference/secret-security/secret-types#dependabot-secrets

Useful? React with 👍 / 👎.

@j-d-ha j-d-ha left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@ncipollina
ncipollina merged commit 1209ba8 into main Jul 22, 2026
2 checks passed
@ncipollina
ncipollina deleted the ci/dependabot-app-token branch July 22, 2026 18:37
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.

2 participants