Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 46 additions & 21 deletions .github/workflows/touchstone-comment.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
name: Continuous Benchmarks (Comment)

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

on:
workflow_run:
workflows: ["Continuous Benchmarks (Receive)"]
types:
- completed

jobs:
upload:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' }}
steps:
- uses: lorenzwalthert/touchstone/actions/comment@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Continuous Benchmarks (Comment)

concurrency:
group: ${{ github.workflow }}-${{ github.run_id }}
cancel-in-progress: true

on:
workflow_run:
workflows: ["Continuous Benchmarks (Receive)"]
types: [completed]

jobs:
comment:
runs-on: ubuntu-latest
permissions:
actions: read
pull-requests: write
if: ${{ github.event.workflow_run.event == 'pull_request' }}
steps:
- name: Download Touchstone artifact
id: download
uses: actions/download-artifact@v8
with:
name: pr
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ github.event.workflow_run.id }}

# defensive since issues could cause commenting in random places
- name: Read PR number
id: pr
shell: bash
run: |
number="$(tr -cd '0-9' < ./NR)"
test -n "$number"
echo "number=$number" >> "$GITHUB_OUTPUT"

- name: Create or update sticky PR comment
id: comment
uses: marocchino/sticky-pull-request-comment@v3
with:
GITHUB_TOKEN: ${{ github.token }}
number_force: ${{ steps.pr.outputs.number }}
header: touchstone
path: ./info.txt
skip_unchanged: true
Loading