chore: improve tooling quality and docs
- close_issue.sh: add set -euo pipefail, argument validation, confirmation output - mark_issue.sh: track previously untracked claim/release script - create_pr.sh: remove hardcoded one-off (use create_pr.py instead) - README.md: reflect current toolset with usage examples - .gitignore: ignore venv/ and __pycache__/
This commit is contained in:
+16
-4
@@ -1,15 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
# Close a Gitea issue by setting its state to "closed".
|
||||
#
|
||||
# Usage: ./close_issue.sh <issue_number>
|
||||
#
|
||||
# Auth: macOS keychain via `git credential fill` (same as the other scripts).
|
||||
set -euo pipefail
|
||||
|
||||
HOST="gitea.dadeschools.net"
|
||||
API="https://$HOST/api/v1"
|
||||
ORG="Contractor"
|
||||
REPO="Timesheet"
|
||||
ISSUE_NUM=$1
|
||||
|
||||
ISSUE_NUM="${1:?usage: close_issue.sh <issue_number>}"
|
||||
|
||||
CREDS=$(printf "host=%s\nprotocol=https\n\n" "$HOST" | git credential fill)
|
||||
USER=$(printf '%s\n' "$CREDS" | sed -n 's/^username=//p')
|
||||
PASS=$(printf '%s\n' "$CREDS" | sed -n 's/^password=//p')
|
||||
|
||||
AUTH=(-u "$USER:$PASS")
|
||||
PAYLOAD='{"state": "closed"}'
|
||||
curl -sSL -X PATCH \
|
||||
-u "$USER:$PASS" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state": "closed"}' \
|
||||
"$API/repos/$ORG/$REPO/issues/$ISSUE_NUM"
|
||||
|
||||
curl -sSL -X PATCH "${AUTH[@]}" -H "Content-Type: application/json" -d "$PAYLOAD" "$API/repos/$ORG/$REPO/issues/$ISSUE_NUM"
|
||||
echo ""
|
||||
echo "#$ISSUE_NUM closed"
|
||||
|
||||
Reference in New Issue
Block a user