Skip to content

Instantly share code, notes, and snippets.

@Baldrani
Created February 6, 2026 06:59
Show Gist options
  • Select an option

  • Save Baldrani/2b40d2ef904eedeb13125aeadd216206 to your computer and use it in GitHub Desktop.

Select an option

Save Baldrani/2b40d2ef904eedeb13125aeadd216206 to your computer and use it in GitHub Desktop.
Run a Github action without merging to main

Running GitHub Actions Workflow from Terminal

Trigger workflow from a feature branch

gh workflow run "Publish beta package (TEST)" \
  --repo Launchmetrics/GIS-shared \
  --ref m-fix-beta-package-workflow \
  --field pr-number=332 \
  --field targets=GIS-mekong:m-feature-test-new

Parameters:

  • --ref: The branch containing the workflow file to run
  • --field pr-number: The PR number to publish packages from
  • --field targets: Target repos in format repo:branch (comma-separated for multiple)

List recent workflow runs

gh run list --repo Launchmetrics/GIS-shared --workflow="Publish beta package (TEST)" --limit 5

Watch a workflow run in real-time

gh run watch <run-id> --repo Launchmetrics/GIS-shared

View workflow run status

gh run view <run-id> --repo Launchmetrics/GIS-shared

View logs for a specific job

gh run view <run-id> --repo Launchmetrics/GIS-shared --job=<job-id>

View full logs

gh run view <run-id> --repo Launchmetrics/GIS-shared --log

Example: Full workflow

# 1. Trigger the workflow
gh workflow run "Publish beta package (TEST)" \
  --repo Launchmetrics/GIS-shared \
  --ref m-fix-beta-package-workflow \
  --field pr-number=332 \
  --field targets=GIS-mekong:m-feature-branch

# 2. Get the run ID
gh run list --repo Launchmetrics/GIS-shared --workflow="Publish beta package (TEST)" --limit 1

# 3. Watch it run
gh run watch <run-id> --repo Launchmetrics/GIS-shared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment