diff --git a/.github/workflows/diff-comment.yml b/.github/workflows/diff-comment.yml index e446bd50a..5078acfe9 100644 --- a/.github/workflows/diff-comment.yml +++ b/.github/workflows/diff-comment.yml @@ -18,22 +18,22 @@ jobs: steps: - name: Delete previous comments - uses: actions/github-script@10b53a9ec6c222bb4ce97aa6bd2b5f739696b536 # v4.2.0 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const { data: comments } = await github.issues.listComments({...context.repo, issue_number: context.issue.number}); + const { data: comments } = await github.rest.issues.listComments({...context.repo, issue_number: context.issue.number}); const comment = comments.find(comment => comment.user.type === "Bot" && comment.body.indexOf("Version diff") > -1); if (comment) { - await github.issues.deleteComment({...context.repo, comment_id: comment.id}); + await github.rest.issues.deleteComment({...context.repo, comment_id: comment.id}); } - name: Add version diff comment - uses: actions/github-script@10b53a9ec6c222bb4ce97aa6bd2b5f739696b536 # v4.2.0 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - github.issues.createComment({ + github.rest.issues.createComment({ ...context.repo, issue_number: context.issue.number, body: "## Version diff\nhttps://github.com/cds-snc/forms-terraform/compare/${{ inputs.base }}...${{ inputs.ref }}" diff --git a/.github/workflows/terraform-version-check.yml b/.github/workflows/terraform-version-check.yml index 394fc4678..207c7733e 100644 --- a/.github/workflows/terraform-version-check.yml +++ b/.github/workflows/terraform-version-check.yml @@ -36,19 +36,19 @@ jobs: echo "terragrunt=${TERRAGRUNT_USED}" >> $GITHUB_OUTPUT - name: Delete previous comments - uses: actions/github-script@10b53a9ec6c222bb4ce97aa6bd2b5f739696b536 # v4.2.0 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const { data: comments } = await github.issues.listComments({...context.repo, issue_number: context.issue.number}); + const { data: comments } = await github.rest.issues.listComments({...context.repo, issue_number: context.issue.number}); const comment = comments.find(comment => comment.user.type === "Bot" && comment.body.indexOf("Terrform update available") > -1); if (comment) { - await github.issues.deleteComment({...context.repo, comment_id: comment.id}); + await github.rest.issues.deleteComment({...context.repo, comment_id: comment.id}); } - name: Add version comment if: steps.latest.outputs.terraform != steps.used.outputs.terraform || steps.latest.outputs.terragrunt != steps.used.outputs.terragrunt - uses: actions/github-script@10b53a9ec6c222bb4ce97aa6bd2b5f739696b536 # v4.2.0 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -56,7 +56,7 @@ jobs: const tg = { used: "${{ steps.used.outputs.terragrunt }}", latest: "${{ steps.latest.outputs.terragrunt }}" }; const terraform = tf.used !== tf.latest ? `\nTerraform: ${tf.latest} (using ${tf.used})` : ""; const terragrunt = tg.used !== tg.latest ? `\nTerragrunt: ${tg.latest} (using ${tg.used})` : ""; - github.issues.createComment({ + github.rest.issues.createComment({ ...context.repo, issue_number: context.issue.number, body: `## ⚠ Terrform update available\n\`\`\`yaml${terraform}${terragrunt}\n\`\`\``