-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Update existing bot comment #1286
Changes from all commits
b62ecfd
0bc3a49
8e6b7b3
50c54c6
8d1d999
4ea6bf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build-scan-url: ${{ steps.build.outputs.build-scan-url }} | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
@@ -36,10 +38,43 @@ jobs: | |
with: | ||
arguments: "clean build" | ||
|
||
- name: Add ubuntu-workflow Build Scan URL to Pull Request | ||
uses: mshick/add-pr-comment@v1 | ||
publish-scan-url: | ||
needs: [ build ] | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get current time | ||
uses: 1466587594/get-current-time@v2 | ||
id: current-time | ||
with: | ||
format: 'YYYY-MM-DD HH:mm:ss' | ||
utcOffset: "+00:00" | ||
|
||
- name: Find Comment | ||
uses: peter-evans/find-comment@v1 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably for push events, it will be null, but I am not sure if we should take care of it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe skip past push events and only check for a creation of pull request? @pawelpasterz |
||
comment-author: 'github-actions[bot]' | ||
body-includes: Buildscan url for ubuntu-workflow run | ||
|
||
- name: Create comment | ||
if: ${{ steps.fc.outputs.comment-id == 0 }} | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
**Timestamp:** ${{ steps.current-time.outputs.formattedTime }} | ||
**Buildscan url for ubuntu-workflow run [${{ github.run_id }}](https://github.com/Flank/flank/actions/runs/${{ github.run_id }})** | ||
${{ needs.build.outputs.build-scan-url }} | ||
|
||
- name: Update comment | ||
if: ${{ steps.fc.outputs.comment-id != 0 }} | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
message: | | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
edit-mode: replace | ||
body: | | ||
**Timestamp:** ${{ steps.current-time.outputs.formattedTime }} | ||
**Buildscan url for ubuntu-workflow run [${{ github.run_id }}](https://github.com/Flank/flank/actions/runs/${{ github.run_id }})** | ||
${{ steps.build.outputs.build-scan-url }} | ||
${{ needs.build.outputs.build-scan-url }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what a strange usename