Created
January 30, 2025 06:21
-
-
Save garywill/8cfcbda62197c145e100079fce334d3c to your computer and use it in GitHub Desktop.
Revisions
-
garywill created this gist
Jan 30, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #!/bin/bash # https://docs.github.com/zh/rest/actions/workflows#create-a-workflow-dispatch-event echo -n "Enter GitHub token: " # Disable echo. stty -echo read token # Enable echo. stty echo echo username= repo= workflow_id= ci_branch= curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $token" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/$username/$repo/actions/workflows/$workflow_id/dispatches \ -d '{"ref":"'"$ci_branch"'"}'