From 1a19f1e26662e70eb9893c102f1c3fd9bda8f696 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Wed, 2 Jul 2025 19:21:48 +1000 Subject: [PATCH] update workflow --- .github/workflows/validate-readme.yml | 31 +++++++++++---------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/validate-readme.yml b/.github/workflows/validate-readme.yml index 7a1efe1..e469a65 100644 --- a/.github/workflows/validate-readme.yml +++ b/.github/workflows/validate-readme.yml @@ -11,6 +11,9 @@ on: jobs: validate-readme: + permissions: + pull-requests: write + contents: read runs-on: ubuntu-latest steps: - name: Checkout code @@ -42,31 +45,23 @@ jobs: - name: Comment on PR if README.md needs updating if: steps.check-diff.outputs.status == 'failure' - uses: actions/github-script@v7 + uses: marocchino/sticky-pull-request-comment@v2 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const diff = `${{ steps.check-diff.outputs.diff }}`; - const body = `## ⚠️ README.md needs to be updated + header: readme-validation + message: | + ## ⚠️ README.md needs to be updated - The \`update-readme.js\` script detected changes that need to be made to the README.md file. + The `update-readme.js` script detected changes that need to be made to the README.md file. - Please run \`node update-readme.js\` locally and commit the changes before merging this PR. + Please run `node update-readme.js` locally and commit the changes before merging this PR.
View diff - \`\`\`diff - ${diff} - \`\`\` -
`; - - github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: body - }); + ```diff + ${{ steps.check-diff.outputs.diff }} + ``` + - name: Fail workflow if README.md needs updating if: steps.check-diff.outputs.status == 'failure'