Run the "Generate Translations" GitHub Actions workflow for the current repo, wait for it to complete, and pull the resulting commit.
-
Identify the repo:
- Run
git remote -vto find the GitHub repo. Prefer a remote pointing to astrangerstudiosGitHub org, thenupstream, then fall back toorigin. Extract theowner/repofrom the URL. - Run
git branch --show-currentto get the current branch name.
- Run
-
Check for uncommitted changes:
- Run
git status. If there are any uncommitted changes (staged, unstaged, or untracked), show them to the user and abort with an error. All changes must be committed before running this command.
- Run
-
Check that all commits are pushed:
- Run
git statusto check if the branch is ahead of the remote. - If the local branch is ahead of the remote (unpushed commits exist), abort with an error telling the user to push first.
- Run
-
Trigger the workflow:
- Run:
gh workflow run generate-translations.yml --ref <current-branch> --repo <owner/repo> - Wait a few seconds, then find the new run ID using:
gh run list --workflow=generate-translations.yml --repo <owner/repo> --branch <current-branch> --limit 1 --json databaseId
- Run:
-
Wait for the workflow to complete:
- Run:
gh run watch <run-id> --repo <owner/repo> - If the workflow fails, show the user the failure details and abort.
- Run:
-
Pull the new commit:
- Run
git pullto bring down the commit created by the workflow. - Show the user the new commit (short hash + message) to confirm success.
- Run