Skip to content

.github/workflows/lighthouse-pr-comment.yml #1246

.github/workflows/lighthouse-pr-comment.yml

.github/workflows/lighthouse-pr-comment.yml #1246

# This is needed by GitHub limitations on PRs from forks,
# replace it when they resolve the issue with a more
# ergonomic system.
on:
workflow_run:
workflows: [lighthouse]
types: [completed]
jobs:
lighthouse-pr-comment:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: dawidd6/action-download-artifact@v2
with:
name: lighthouse-pr-comment
run_id: ${{ github.event.workflow_run.id }}
- id: pr_number
run: |
export PR_NUM=$(ls lighthouse-pr-comment-*.txt | sed -n 's/lighthouse-pr-comment-\(.*\).txt/\1/p')
echo "pr_num=$PR_NUM" >> $GITHUB_OUTPUT
- uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.pr_number.outputs.pr_num }}
path: lighthouse-pr-comment-${{ steps.pr_number.outputs.pr_num }}.txt