Merge pull request 'fix: dev/dev-agent.sh:334 — 'in-progress' label still passed as string name to POST /labels (#222)' (#389) from fix/issue-222 into main
This commit is contained in:
commit
de26c4d073
1 changed files with 8 additions and 3 deletions
|
|
@ -45,6 +45,11 @@ BACKLOG_LABEL_ID=$(codeberg_api GET "/labels" 2>/dev/null \
|
||||||
| jq -r '.[] | select(.name == "backlog") | .id' 2>/dev/null || true)
|
| jq -r '.[] | select(.name == "backlog") | .id' 2>/dev/null || true)
|
||||||
BACKLOG_LABEL_ID="${BACKLOG_LABEL_ID:-1300815}"
|
BACKLOG_LABEL_ID="${BACKLOG_LABEL_ID:-1300815}"
|
||||||
|
|
||||||
|
# Same for "in-progress" label
|
||||||
|
IN_PROGRESS_LABEL_ID=$(codeberg_api GET "/labels" 2>/dev/null \
|
||||||
|
| jq -r '.[] | select(.name == "in-progress") | .id' 2>/dev/null || true)
|
||||||
|
IN_PROGRESS_LABEL_ID="${IN_PROGRESS_LABEL_ID:-1300818}"
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
printf '[%s] #%s %s\n' "$(date -u '+%Y-%m-%d %H:%M:%S UTC')" "$ISSUE" "$*" >> "$LOGFILE"
|
printf '[%s] #%s %s\n' "$(date -u '+%Y-%m-%d %H:%M:%S UTC')" "$ISSUE" "$*" >> "$LOGFILE"
|
||||||
}
|
}
|
||||||
|
|
@ -119,7 +124,7 @@ cleanup_worktree() {
|
||||||
cleanup_labels() {
|
cleanup_labels() {
|
||||||
curl -sf -X DELETE \
|
curl -sf -X DELETE \
|
||||||
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||||
"${API}/issues/${ISSUE}/labels/in-progress" >/dev/null 2>&1 || true
|
"${API}/issues/${ISSUE}/labels/${IN_PROGRESS_LABEL_ID}" >/dev/null 2>&1 || true
|
||||||
}
|
}
|
||||||
|
|
||||||
CLAIMED=false
|
CLAIMED=false
|
||||||
|
|
@ -132,7 +137,7 @@ cleanup() {
|
||||||
log "cleanup: unclaiming issue (no PR created)"
|
log "cleanup: unclaiming issue (no PR created)"
|
||||||
curl -sf -X DELETE \
|
curl -sf -X DELETE \
|
||||||
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||||
"${API}/issues/${ISSUE}/labels/in-progress" >/dev/null 2>&1 || true
|
"${API}/issues/${ISSUE}/labels/${IN_PROGRESS_LABEL_ID}" >/dev/null 2>&1 || true
|
||||||
curl -sf -X POST \
|
curl -sf -X POST \
|
||||||
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
|
|
@ -343,7 +348,7 @@ curl -sf -X POST \
|
||||||
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
"${API}/issues/${ISSUE}/labels" \
|
"${API}/issues/${ISSUE}/labels" \
|
||||||
-d '{"labels":["in-progress"]}' >/dev/null 2>&1 || true
|
-d "{\"labels\":[${IN_PROGRESS_LABEL_ID}]}" >/dev/null 2>&1 || true
|
||||||
|
|
||||||
curl -sf -X DELETE \
|
curl -sf -X DELETE \
|
||||||
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue