From ee086c27796e41180a6e153186055562a58a8da8 Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Fri, 10 May 2024 16:57:34 +0200 Subject: [PATCH] added url of comment --- .github/workflows/cmd-action.yml | 15 +++++++-------- src/commenters.ts | 6 +++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cmd-action.yml b/.github/workflows/cmd-action.yml index 98e857f..fcb288e 100644 --- a/.github/workflows/cmd-action.yml +++ b/.github/workflows/cmd-action.yml @@ -31,22 +31,21 @@ jobs: branch: ${{ needs.cmd-check.outputs.branch }} command: ${{ matrix.command.command }} name: ${{ matrix.command.name }} - pr-number: ${{ github.event.issue.number || github.event.pull_request.number }} + pr-number: ${{ github.event.issue.number }} # If you need to push your changes you can do so like this - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: cmd-action - changes branch: ${{ needs.cmd-check.outputs.branch }} - pr-number: ${{ github.event.issue.number || github.event.pull_request.number }} - conclude: - runs-on: ubuntu-latest - name: Run completed - needs: [cmd-run] # It will only run if all the runs were completed - steps: + conclude: + runs-on: ubuntu-latest + name: Run completed + needs: [cmd-run] # It will only run if all the runs were completed + steps: - name: Report Success shell: bash run: gh pr comment $NUMBER --repo ${{ github.repository }} --body "Completed action run. See logs here." env: RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GH_TOKEN: ${{ github.token }} - NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} + NUMBER: ${{ github.event.issue.number }} diff --git a/src/commenters.ts b/src/commenters.ts index e0f8878..f93a1a4 100644 --- a/src/commenters.ts +++ b/src/commenters.ts @@ -9,7 +9,7 @@ export class Commenter { private readonly comment: IssueCommentCreatedEvent, private readonly actionUrl: string, private readonly logger: ActionLogger, - ) {} + ) { } async commentError(): Promise { this.logger.debug(`Reacting with -1 to ${this.comment.comment.id}`); @@ -24,7 +24,7 @@ export class Commenter { await this.github.rest.issues.createComment({ ...this.repo, issue_number: this.comment.issue.number, - body: `❌ Failed while parsing command. Find error in the logs.`, + body: `## Failed while parsing command ❌\n\n` + `Find error in the logs.`, }); } @@ -41,7 +41,7 @@ export class Commenter { await this.github.rest.issues.createComment({ ...this.repo, issue_number: this.comment.issue.number, - body: `Run has been triggered. Follow it in here.`, + body: `Run has been triggered by command.\n` + `Follow it in here.`, }); } }