chore: Add tofu workflows #1

Merged
Peter merged 82 commits from pgi-add-workflows into main 2026-02-18 22:55:53 +01:00
Showing only changes of commit ad94bf30e4 - Show all commits

View file

@ -63,7 +63,7 @@ jobs:
comment_id=$(echo "$response" | jq -r \ comment_id=$(echo "$response" | jq -r \
'.[] | select(.body | test("${{ forge.workflow }}")) | .id' | head -n 1) '.[] | select(.body | test("${{ forge.workflow }}")) | .id' | head -n 1)
echo "comment_id=$comment_id" echo "$comment_id"
- name: Add comment - name: Add comment
id: comment id: comment
@ -80,39 +80,39 @@ jobs:
PLAN_OUTPUT="$(emoji ${{ steps.plan.outcome }}) OpenTofu Plan 📖" PLAN_OUTPUT="$(emoji ${{ steps.plan.outcome }}) OpenTofu Plan 📖"
COMMENT_BODY=$(cat <<EOF COMMENT_BODY=$(cat <<EOF
### ${{ forge.workflow }} ### ${{ forge.workflow }}
${FMT_OUTPUT} ${FMT_OUTPUT}
${INIT_OUTPUT} ${INIT_OUTPUT}
${VALIDATE_OUTPUT} ${VALIDATE_OUTPUT}
<details><summary>Validation Output</summary> <details><summary>Validation Output</summary>
``` ```
${{ steps.validate.outputs.stdout }} ${{ steps.validate.outputs.stdout }}
``` ```
</details> </details>
${PLAN_OUTPUT} ${PLAN_OUTPUT}
<details><summary>Show Plan</summary> <details><summary>Show Plan</summary>
``` ```
${{ steps.plan.outputs.stdout }} ${{ steps.plan.outputs.stdout }}
``` ```
</details> </details>
EOF EOF
) )
payload=$(jq -Rs --arg body "$COMMENT_BODY" '{body: $body}' <<< "$COMMENT_BODY") payload=$(jq -Rs --arg body "$COMMENT_BODY" '{body: $body}' <<< "$COMMENT_BODY")
if [ -n "${{ steps.fetch.outputs.comment_id }}" ] && [ "${{ steps.fetch.outputs.comment_id }}" != "null" ]; then if [ -n "${{ steps.fetch.outputs }}" ] && [ "${{ steps.fetch.outputs }}" != "null" ]; then
curl -s -X PATCH \ curl -s -X PATCH \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
"${{ forge.api_url }}/repos/${{ forge.repository }}/issues/comments/${{ steps.fetch.outputs.comment_id }}" \ "${{ forge.api_url }}/repos/${{ forge.repository }}/issues/comments/${{ steps.fetch.outputs }}" \
-d "$payload" -d "$payload"
else else
curl -s -X POST \ curl -s -X POST \