Skip to content

Commit

Permalink
chore(deps): update actions/github-script action to v7 (#687)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pat Heard <[email protected]>
  • Loading branch information
renovate[bot] and patheard authored Jun 14, 2024
1 parent a3bdd69 commit a7f1bc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/diff-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/terraform-version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ 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: |
const tf = { used: "${{ steps.used.outputs.terraform }}", latest: "${{ steps.latest.outputs.terraform }}" };
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\`\`\``
Expand Down

0 comments on commit a7f1bc4

Please sign in to comment.