diff --git a/.github/workflows/auto_comment_pr_merge.yml b/.github/workflows/auto_comment_pr_merge.yml index de93728..9398eeb 100644 --- a/.github/workflows/auto_comment_pr_merge.yml +++ b/.github/workflows/auto_comment_pr_merge.yml @@ -11,16 +11,26 @@ permissions: jobs: comment: runs-on: ubuntu-latest + permissions: + pull-requests: write if: github.event.pull_request.merged == true steps: - - name: Add Comment to PR - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.name, - issue_number: context.issue.number, - body: '🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there\'s anything else we can assist you with. Keep up the fantastic work! 🚀' - }); \ No newline at end of file + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Add Comment to Issue + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + COMMENT=$(cat < label.name === 'needs triage')) { - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.name, - issue_number: issue.number, - labels: ['needs triage'] - }); - } - } \ No newline at end of file + - name: Check Issue Template + if: github.event.issue.body == null || !github.event.issue.body.contains('Your Name') + run: | + echo "::error::The issue does not follow the required template. Please fill out all fields." + exit 1