Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Created April 21, 2026 13:11
Show Gist options
  • Select an option

  • Save dparker1005/4a10cd281b53cff8b51ae7ff4eac3365 to your computer and use it in GitHub Desktop.

Select an option

Save dparker1005/4a10cd281b53cff8b51ae7ff4eac3365 to your computer and use it in GitHub Desktop.
Run the "Generate Translations" GitHub Actions workflow for the current repo, wait for it to complete, and pull the resulting commit.

Generate Translations

Run the "Generate Translations" GitHub Actions workflow for the current repo, wait for it to complete, and pull the resulting commit.

Steps

  1. Identify the repo:

    • Run git remote -v to find the GitHub repo. Prefer a remote pointing to a strangerstudios GitHub org, then upstream, then fall back to origin. Extract the owner/repo from the URL.
    • Run git branch --show-current to get the current branch name.
  2. 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.
  3. Check that all commits are pushed:

    • Run git status to 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.
  4. 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
  5. 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.
  6. Pull the new commit:

    • Run git pull to bring down the commit created by the workflow.
    • Show the user the new commit (short hash + message) to confirm success.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment