Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions disable-all-workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ if ! gh auth status > /dev/null 2>&1; then
exit 1
fi

# block if the logged-in user does not match the target repo owner
LOGGED_IN_USER=$(gh auth status --json hosts --jq '.hosts["github.com"][] | select(.active) | .login')
if [[ "${LOGGED_IN_USER}" != "${OWNER}" ]]; then
echo "❌ Logged-in user '${LOGGED_IN_USER}' does not match repo owner '${OWNER}'. Aborting."
exit 1
fi

# get IDs of only active workflows
active_ids=$(gh api \
--method GET \
Expand Down