Skip to content

Instantly share code, notes, and snippets.

@dmitrym0
Created May 30, 2024 17:12
Show Gist options
  • Save dmitrym0/f9d37d4975103c19c9332edd65f7699b to your computer and use it in GitHub Desktop.
Save dmitrym0/f9d37d4975103c19c9332edd65f7699b to your computer and use it in GitHub Desktop.
a script to select a workflow and specify a branch to run this workflow on
#!/bin/sh
# List workflows, pick one with fzf, get its ID
workflow_id=$(gh workflow list --json id,name | jq -r '.[] | "\(.id) \(.name)"' | fzf --prompt="Select Workflow: " | awk '{print $1}')
# List branches, pick one with fzf
branch=$(git branch -r | sed 's/origin\///' | fzf --prompt="Select Branch: ")
# Run the selected workflow with the specified b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment