Merge pull request 'style 💎: Remove unnecessary blank line and ensure consistent formatting' (#25) from dev into main
Reviewed-on: #25
This commit was merged in pull request #25.
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
# .gitea/workflows/ansible-lint.yml
|
||||
name: ansible-lint
|
||||
|
||||
on: [issues, push]
|
||||
on:
|
||||
push:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
# .gitea/workflows/markdown-lint.yml
|
||||
name: Markdown Lint
|
||||
|
||||
on: [issues, push]
|
||||
on:
|
||||
push:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -104,6 +104,14 @@ jobs:
|
||||
"$API/issues/$PR/comments"
|
||||
fi
|
||||
|
||||
# Remove ci-pass +label if exists
|
||||
LABELS=$(curl -s -H "Authorization: token $TOKEN" "$API/issues/$PR/labels" | jq -r '.[] | .name')
|
||||
if echo "$LABELS" | grep -q "^ci-pass$"; then
|
||||
curl -s -X DELETE \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
"$API/issues/$PR/labels/ci-pass"
|
||||
fi
|
||||
|
||||
# Add label if missing
|
||||
LABELS=$(curl -s -H "Authorization: token $TOKEN" "$API/issues/$PR/labels" | jq -r '.[] | .name')
|
||||
if ! echo "$LABELS" | grep -q "^ci-failed$"; then
|
||||
@@ -147,9 +155,15 @@ jobs:
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"body\":\"<!--ci-failed-comment-->\n$COMMENT_BODY\"}" \
|
||||
"$API/issues/$PR/comments/$EXISTING_COMMENT_ID"
|
||||
else
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$COMMENT_PAYLOAD" \
|
||||
"$API/issues/$PR/comments"
|
||||
fi
|
||||
|
||||
# Remove label if exists
|
||||
# Remove ci-failed +label if exists
|
||||
LABELS=$(curl -s -H "Authorization: token $TOKEN" "$API/issues/$PR/labels" | jq -r '.[] | .name')
|
||||
if echo "$LABELS" | grep -q "^ci-failed$"; then
|
||||
curl -s -X DELETE \
|
||||
@@ -157,6 +171,16 @@ jobs:
|
||||
"$API/issues/$PR/labels/ci-failed"
|
||||
fi
|
||||
|
||||
# Add ci-pass if not present
|
||||
if ! echo "$LABELS" | grep -q "^ci-pass$"; then
|
||||
echo "Adding ci-pass label"
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"labels":["ci-pass"]}' \
|
||||
"$API/issues/$PR/labels"
|
||||
fi
|
||||
|
||||
# Reopen PR if closed
|
||||
PR_STATE=$(curl -s -H "Authorization: token $TOKEN" "$API/pulls/$PR" | jq -r '.state')
|
||||
if [ "$PR_STATE" = "closed" ]; then
|
||||
|
||||
Reference in New Issue
Block a user