Skip to content

Use dedicated GitHub App to import untracked repositories - #2973

Open
marcoienibot wants to merge 1 commit into
rust-lang:mainfrom
marcoienibot:t3/untracked-repos-app-environment
Open

marcoienibot wants to merge 1 commit into
rust-lang:mainfrom
marcoienibot:t3/untracked-repos-app-environment

Conversation

@marcoienibot

@marcoienibot marcoienibot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #2967. This should make the Check Untracked Repositories workflow able to push the automation branch and open its pull request.

I created the github app https://github.com/organizations/rust-lang/settings/apps/team-untracked-repos and set up the secrets.

Known limitation

The App has no Workflows permission. If an automation PR stays open while a change to .github/workflows/ lands on main, GitHub may reject the next force-push of the automation branch.

But this can be fixed in a follow-up PR if something wants to do it.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Dry-run check results

[WARN  rust_team::sync] sync-team is running in dry mode, no changes will be applied.
[INFO  rust_team::sync] synchronizing crates-io
[INFO  rust_team::sync] synchronizing github
[INFO  rust_team::sync] Rate limits before: REST 14054/15000 remaining, resets at 2026-11-20 17:39:25 UTC, GraphQL 12316/12500 remaining, resets at 2026-11-20 17:39:24 UTC
[INFO  rust_team::sync] Rate limits after: REST 13581/15000 remaining, resets at 2026-11-20 17:39:25 UTC, GraphQL 12213/12500 remaining, resets at 2026-11-20 17:39:24 UTC
[INFO  rust_team::sync] Consumed 473 REST calls and 103 GraphQL calls

client-id: ${{ secrets.SYNC_TEAM_GH_APP_ID }}
private-key: ${{ secrets.SYNC_TEAM_GH_APP_PRIVATE_KEY }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh pr close --delete-branch "$AUTOMATION_BRANCH"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I also added --delete-branch to delete the branch after closing the PR

sync-team-app is read-only, so pushing the automation branch always
failed with a 403. Use the credentials of a dedicated GitHub App, stored
in the `untracked-repos` environment, and scope its token to contents
and pull requests. GITHUB_TOKEN no longer needs to push.

Co-authored-by: marcoienibot <206998110+marcoienibot@users.noreply.github.com>
@marcoieni
marcoieni force-pushed the t3/untracked-repos-app-environment branch from 31bf751 to 642b5b7 Compare November 20, 2026 16:57
@marcoieni
marcoieni marked this pull request as ready for review November 20, 2026 17:15

This branch has not been deployed

No deployments
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.

3 participants