Skip to content

Create configs when untracked repos found#2630

Open
cuba0001 wants to merge 1 commit into
rust-lang:mainfrom
cuba0001:untracked-repos
Open

Create configs when untracked repos found#2630
cuba0001 wants to merge 1 commit into
rust-lang:mainfrom
cuba0001:untracked-repos

Conversation

@cuba0001

@cuba0001 cuba0001 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Related to #2582

According to the discussion in the previous #2611 it creates missing toml files. I added an exit code 2 to signal that untracked repos are found and configs are created, because this is the simplest way for the workflow to handle it. This still keeps code 1 for unexpected errors. When code 2 happens, the workflow checks if any PR exists, like it's done in josh-sync. Depending on it, the job either creates a new branch or switches to an existing one and runs sync-team. Thereby, previously created toml files won't be duplicated in the existing PR scenario.

@github-actions

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

@Kobzol Kobzol left a comment

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.

Hi, thanks for the PR! I quickly glanced at the YAML file only, left one comment.

env:
GITHUB_TOKEN: ${{ github.token }} # this one is generated by GHA
run: |
EXISTING_PULL_REQUEST_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.

The branch name is a constant, same as in josh-sync. I don't think we need this lookup complexity.

  1. Run the team command and check if any TOML file was generated, according to its exit code
  2. If yes, create the new branch, add the TOML files, commit it, and push to the branch
  3. If a PR does not exist at the moment, create it from that branch

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