Something went wrong. Try again.
[mirror] R Package for a Mildly Opinionated Stan Bayesian Workflow stanflow.visruth.com
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596name: Continuous Benchmarks (Comment)
concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true
on: workflow_run: workflows: [ "Continuous Benchmarks (Receive)" ] types: [ completed ]
jobs: comment: runs-on: ubuntu-latest permissions: actions: read contents: write pull-requests: write if: ${{ github.event.workflow_run.event == 'pull_request' }} steps: - uses: actions/checkout@v7
- name: Download Touchstone comment artifact id: download_comment uses: actions/download-artifact@v8 with: name: pr path: ./pr github-token: ${{ github.token }} repository: ${{ github.repository }} run-id: ${{ github.event.workflow_run.id }}
- name: Download Touchstone plot artifact id: download_plots continue-on-error: true uses: actions/download-artifact@v8 with: name: visual-benchmarks path: ./plots 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' < ./pr/NR)" test -n "$number" echo "number=$number" >> "$GITHUB_OUTPUT"
- name: Publish Touchstone plots if: ${{ steps.download_plots.outcome == 'success' }} uses: JamesIves/github-pages-deploy-action@v4.8.0 with: branch: touchstone-plots folder: plots target-folder: pr-${{ steps.pr.outputs.number }} commit-message: touchstone plots for PR #${{ steps.pr.outputs.number }} clean: false
- name: Build comment body shell: bash env: PR_NUMBER: ${{ steps.pr.outputs.number }} run: | set -euo pipefail
cp ./pr/info.txt ./comment.txt
if ! compgen -G "./plots/*.png" > /dev/null; then exit 0 fi
{ printf '\n\n<details>\n<summary>Plots</summary>\n\n'
for plot in ./plots/*.png; do file="$(basename "$plot")" label="${file%.png}" printf '\n\n' "$label" "$PR_NUMBER" "$file" done
printf '</details>\n' } >> ./comment.txt
- 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: ./comment.txt