Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
added url of comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed May 10, 2024
1 parent d30848b commit ee086c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/cmd-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href=\"$RUN\">here</a>."
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 }}
6 changes: 3 additions & 3 deletions src/commenters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class Commenter {
private readonly comment: IssueCommentCreatedEvent,
private readonly actionUrl: string,
private readonly logger: ActionLogger,
) {}
) { }

Check failure on line 12 in src/commenters.ts

View workflow job for this annotation

GitHub Actions / running lint

Delete `·`

async commentError(): Promise<void> {
this.logger.debug(`Reacting with -1 to ${this.comment.comment.id}`);
Expand All @@ -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 <a href="${this.actionUrl}">the logs</a>.`,
body: `## Failed while parsing <a href="${this.comment.issue.html_url}">command</a> ❌\n\n` + `Find error in <a href="${this.actionUrl}">the logs</a>.`,

Check failure on line 27 in src/commenters.ts

View workflow job for this annotation

GitHub Actions / running lint

Replace `·`##·Failed·while·parsing·<a·href="${this.comment.issue.html_url}">command</a>·❌\n\n`·+` with `⏎········`##·Failed·while·parsing·<a·href="${this.comment.issue.html_url}">command</a>·❌\n\n`·+⏎·······`
});
}

Expand All @@ -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 <a href="${this.actionUrl}">here</a>.`,
body: `Run has been triggered by <a href="${this.comment.issue.html_url}">command</a>.\n` + `Follow it in <a href="${this.actionUrl}">here</a>.`,

Check failure on line 44 in src/commenters.ts

View workflow job for this annotation

GitHub Actions / running lint

Replace `·`Run·has·been·triggered·by·<a·href="${this.comment.issue.html_url}">command</a>.\n`·+` with `⏎········`Run·has·been·triggered·by·<a·href="${this.comment.issue.html_url}">command</a>.\n`·+⏎·······`
});
}
}

0 comments on commit ee086c2

Please sign in to comment.