7404f768d3
- 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__/
28 lines
749 B
Bash
Executable File
28 lines
749 B
Bash
Executable File
#!/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:?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')
|
|
|
|
curl -sSL -X PATCH \
|
|
-u "$USER:$PASS" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"state": "closed"}' \
|
|
"$API/repos/$ORG/$REPO/issues/$ISSUE_NUM"
|
|
|
|
echo ""
|
|
echo "#$ISSUE_NUM closed"
|