Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/scripts/apply-code-quality-ruleset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set -euo pipefail
REPO="combsmith/markets"
RULESET_NAME="code-quality"

if [ -z "${GH_TOKEN:-}" ]; then
if [[ -z "${GH_TOKEN:-}" ]]; then
echo "ERROR: GH_TOKEN is required with administration:write scope" >&2
exit 1
fi
Expand All @@ -52,7 +52,7 @@ REQUIRED_BYPASS_ACTORS=$(jq -n \

# When updating an existing ruleset, fetch its current bypass actors and merge them
# with the required actors so that other legitimate bypass actors are not silently removed.
if [ -n "$EXISTING_ID" ]; then
if [[ -n "$EXISTING_ID" ]]; then
EXISTING_BYPASS=$(gh api "repos/$REPO/rulesets/$EXISTING_ID" \
--jq '.bypass_actors // []' 2>/dev/null || echo "[]")
BYPASS_ACTORS=$(echo "$EXISTING_BYPASS" | \
Expand Down Expand Up @@ -92,7 +92,7 @@ PAYLOAD=$(jq -n --argjson bypass_actors "$BYPASS_ACTORS" '{
bypass_actors: $bypass_actors
}')

if [ -n "$EXISTING_ID" ]; then
if [[ -n "$EXISTING_ID" ]]; then
echo "Updating existing $RULESET_NAME ruleset (id=$EXISTING_ID) ..."
echo "$PAYLOAD" | gh api -X PUT "repos/$REPO/rulesets/$EXISTING_ID" --input - > /dev/null
echo "Done — ruleset updated: https://github.com/$REPO/rules/$EXISTING_ID"
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/apply-pr-quality-ruleset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set -euo pipefail
REPO="combsmith/markets"
RULESET_NAME="pr-quality"

if [ -z "${GH_TOKEN:-}" ]; then
if [[ -z "${GH_TOKEN:-}" ]]; then
echo "ERROR: GH_TOKEN is required with administration:write scope" >&2
exit 1
fi
Expand Down Expand Up @@ -83,7 +83,7 @@ PAYLOAD=$(jq -n '{
]
}')

if [ -n "$EXISTING_ID" ]; then
if [[ -n "$EXISTING_ID" ]]; then
echo "Updating existing $RULESET_NAME ruleset (id=$EXISTING_ID) ..."
echo "$PAYLOAD" | gh api -X PUT "repos/$REPO/rulesets/$EXISTING_ID" --input - > /dev/null
echo "Done — ruleset updated: https://github.com/$REPO/rules/$EXISTING_ID"
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/apply-repo-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO="combsmith/markets"

if [ -z "${GH_TOKEN:-}" ]; then
if [[ -z "${GH_TOKEN:-}" ]]; then
echo "ERROR: GH_TOKEN is required with administration:write scope" >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/apply-secret-scanning-ai-detection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -euo pipefail

REPO="combsmith/markets"

if [ -z "${GH_TOKEN:-}" ]; then
if [[ -z "${GH_TOKEN:-}" ]]; then
echo "ERROR: GH_TOKEN is required with administration:write scope" >&2
exit 1
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -euo pipefail

REPO="combsmith/markets"

if [ -z "${GH_TOKEN:-}" ]; then
if [[ -z "${GH_TOKEN:-}" ]]; then
echo "ERROR: GH_TOKEN is required with administration:write scope" >&2
exit 1
fi
Expand Down
Loading