Files
Gitea-Tools/create_pr.sh
T
2026-06-21 15:35:57 -04:00

15 lines
587 B
Bash
Executable File

#!/usr/bin/env bash
HOST="gitea.dadeschools.net"
API="https://$HOST/api/v1"
ORG="Contractor"
REPO="Timesheet"
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='{"title": "feat: Support PTO, Sick, Holiday, and Unpaid days", "body": "Closes #6", "head": "feat/6-absence-categories", "base": "main"}'
curl -sSL -X POST "${AUTH[@]}" -H "Content-Type: application/json" -d "$PAYLOAD" "$API/repos/$ORG/$REPO/pulls"