add comment
All checks were successful
tofu plan k8s-wheatley / tofu-plan-k8s-wheatley (pull_request) Successful in 21s
All checks were successful
tofu plan k8s-wheatley / tofu-plan-k8s-wheatley (pull_request) Successful in 21s
This commit is contained in:
parent
951e51f503
commit
23c711d745
1 changed files with 39 additions and 48 deletions
|
|
@ -53,10 +53,6 @@ jobs:
|
||||||
run: tofu plan -no-color
|
run: tofu plan -no-color
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: debug
|
|
||||||
run:
|
|
||||||
echo "${{ toJSON(forge) }}"
|
|
||||||
|
|
||||||
- name: Fetch existing comments
|
- name: Fetch existing comments
|
||||||
id: fetch
|
id: fetch
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -67,48 +63,43 @@ jobs:
|
||||||
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
|
echo "$comment_id"
|
||||||
echo "Unable to fetch comment."
|
|
||||||
exit 1
|
- name: Upsert comment
|
||||||
|
id: comment
|
||||||
|
env:
|
||||||
|
COMMENT_BODY: |
|
||||||
|
`#### OpenTofu Format and Style 🖌\`${{ steps.fmt.outcome }}\`
|
||||||
|
#### OpenTofu Initialization ⚙️\`${{ steps.init.outcome }}\`
|
||||||
|
#### OpenTofu Validation 🤖\`${{ steps.validate.outcome }}\`
|
||||||
|
<details><summary>Validation Output</summary>
|
||||||
|
|
||||||
|
\`\`\`\n
|
||||||
|
${{ steps.validate.outputs.stdout }}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### OpenTofu Plan 📖\`${{ steps.plan.outcome }}\`
|
||||||
|
|
||||||
|
<details><summary>Show Plan</summary>
|
||||||
|
|
||||||
|
\`\`\`\n
|
||||||
|
${process.env.PLAN}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
</details>
|
||||||
|
run: |
|
||||||
|
if [ -n "${{ steps.fetch.outputs.comment_id }}" ] && [ "${{ steps.fetch.outputs.comment_id }}" != "null" ]; then
|
||||||
|
curl -s -X PATCH \
|
||||||
|
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${{ forge.api_url }}/repos/${{ forge.repository }}/issues/comments/${{ steps.fetch.outputs.comment_id }}" \
|
||||||
|
-d "{\"body\":\"$COMMENT_BODY\"}"
|
||||||
|
else
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments" \
|
||||||
|
-d "{\"body\":\"$COMMENT_BODY\"}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "comment_id=$comment_id"
|
|
||||||
|
|
||||||
# - name: Upsert comment
|
|
||||||
# id: comment
|
|
||||||
# env:
|
|
||||||
# COMMENT_BODY: |
|
|
||||||
# `#### OpenTofu Format and Style 🖌\`${{ steps.fmt.outcome }}\`
|
|
||||||
# #### OpenTofu Initialization ⚙️\`${{ steps.init.outcome }}\`
|
|
||||||
# #### OpenTofu Validation 🤖\`${{ steps.validate.outcome }}\`
|
|
||||||
# <details><summary>Validation Output</summary>
|
|
||||||
#
|
|
||||||
# \`\`\`\n
|
|
||||||
# ${{ steps.validate.outputs.stdout }}
|
|
||||||
# \`\`\`
|
|
||||||
#
|
|
||||||
# </details>
|
|
||||||
#
|
|
||||||
# #### OpenTofu Plan 📖\`${{ steps.plan.outcome }}\`
|
|
||||||
#
|
|
||||||
# <details><summary>Show Plan</summary>
|
|
||||||
#
|
|
||||||
# \`\`\`\n
|
|
||||||
# ${process.env.PLAN}
|
|
||||||
# \`\`\`
|
|
||||||
#
|
|
||||||
# </details>
|
|
||||||
# run: |
|
|
||||||
# if [ -n "${{ steps.fetch.outputs.comment_id }}" ] && [ "${{ steps.fetch.outputs.comment_id }}" != "null" ]; then
|
|
||||||
# curl -s -X PATCH \
|
|
||||||
# -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
|
||||||
# -H "Content-Type: application/json" \
|
|
||||||
# "${{ forge.api_url }}/repos/${{ forge.repository }}/issues/comments/${{ steps.fetch.outputs.comment_id }}" \
|
|
||||||
# -d "{\"body\":\"$COMMENT_BODY\"}"
|
|
||||||
# else
|
|
||||||
# curl -s -X POST \
|
|
||||||
# -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
|
||||||
# -H "Content-Type: application/json" \
|
|
||||||
# "${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments" \
|
|
||||||
# -d "{\"body\":\"$COMMENT_BODY\"}"
|
|
||||||
# fi
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue