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 951e51f503 - Show all commits

View file

@ -57,23 +57,23 @@ jobs:
run: run:
echo "${{ toJSON(forge) }}" echo "${{ toJSON(forge) }}"
# - name: Fetch existing comments - name: Fetch existing comments
# id: fetch id: fetch
# run: | run: |
# response=$(curl -s \ response=$(curl -s \
# -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
# "${{ forge.server_url }}/api/v1/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments") "${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments")
#
# comment_id=$(echo "$response" | jq -r \ comment_id=$(echo "$response" | jq -r \
# '.[] | select(.body | test("OpenTofu Format and Style")) | .id' | head -n 1) '.[] | select(.body | test("OpenTofu Format and Style")) | .id' | head -n 1)
#
# if [ -z $comment_id ]; then if [ -z $comment_id ]; then
# echo "Unable to fetch comment." echo "Unable to fetch comment."
# exit 1 exit 1
# fi fi
#
# echo "comment_id=$comment_id" echo "comment_id=$comment_id"
#
# - name: Upsert comment # - name: Upsert comment
# id: comment # id: comment
# env: # env:
@ -103,12 +103,12 @@ jobs:
# 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.server_url }}/api/v1/repos/${{ forge.repository }}/issues/comments/${{ steps.fetch.outputs.comment_id }}" \ # "${{ forge.api_url }}/repos/${{ forge.repository }}/issues/comments/${{ steps.fetch.outputs.comment_id }}" \
# -d "{\"body\":\"$COMMENT_BODY\"}" # -d "{\"body\":\"$COMMENT_BODY\"}"
# else # else
# curl -s -X POST \ # curl -s -X POST \
# -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ # -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
# -H "Content-Type: application/json" \ # -H "Content-Type: application/json" \
# "${{ forge.server_url }}/api/v1/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments" \ # "${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments" \
# -d "{\"body\":\"$COMMENT_BODY\"}" # -d "{\"body\":\"$COMMENT_BODY\"}"
# fi # fi