From a7b20b3999d9216f032fc266584e9e21148d8bbf Mon Sep 17 00:00:00 2001 From: Dylan Pulver <35541198+dylanpulver@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:54:06 -0400 Subject: [PATCH] feat:fixed issue responder (#561) --- .github/workflows/issue_responder.yml | 35 ++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/issue_responder.yml b/.github/workflows/issue_responder.yml index 4df2f27..fab210b 100644 --- a/.github/workflows/issue_responder.yml +++ b/.github/workflows/issue_responder.yml @@ -7,28 +7,25 @@ on: jobs: respond: runs-on: ubuntu-latest + permissions: + issues: write steps: - - name: Respond to new issues - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const issueNumber = context.issue.number; - const issueAuthor = context.payload.issue.user.login; + - name: Checkout repository + uses: actions/checkout@v3 - const commentBody = ` - Hi @${issueAuthor}, thank you for opening this issue! + - name: Install GitHub CLI + run: sudo apt-get install gh - We appreciate your effort in reporting this. Our team will review it and get back to you soon. - If you have any additional details or updates, feel free to add them to this issue. + - name: Respond to new issues + run: gh issue comment ${{ github.event.issue.number }} --body "$BODY" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BODY: | + Hi @${{ github.event.issue.user.login }}, thank you for opening this issue! - **Note:** If this is a serious security issue that could impact the security of Safety CLI users, please email security@safetycli.com immediately. + We appreciate your effort in reporting this. Our team will review it and get back to you soon. + If you have any additional details or updates, feel free to add them to this issue. - Thank you for contributing to Safety CLI! - `; + **Note:** If this is a serious security issue that could impact the security of Safety CLI users, please email security@safetycli.com immediately. - await github.issues.createComment({ - ...context.repo, - issue_number: issueNumber, - body: commentBody - }); + Thank you for contributing to Safety CLI!