Skip to content

Build previews

Build previews #55

name: Build previews
on:
workflow_run:
types:
- 'completed'
workflows:
- 'PR Checks'
jobs:
comment:
name: Add comment with extension preview builds
runs-on: ubuntu-22.04
if: github.repository == 'interledger/web-monetization-extension'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get workflow artifacts
uses: actions/github-script@v7
id: get-workflow-artifacts
with:
script: |
const script = require('./.github/actions/get-workflow-artifacts.cjs')
await script({ github, context, core })
- name: Find comment
if: ${{ steps.get-workflow-artifacts.outputs.conclusion != 'cancelled' }}
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ steps.get-workflow-artifacts.outputs.pr_number }}
comment-author: 'raducristianpopa'
body-includes: '<!-- __WM_EXTENSION_BUILD_PREVIEWS__ -->'
- name: Add/Update comment
if: ${{ steps.get-workflow-artifacts.outputs.conclusion != 'cancelled' }}
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PAT }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ steps.get-workflow-artifacts.outputs.pr_number }}
body: ${{ steps.get-workflow-artifacts.outputs.comment_body }}
edit-mode: replace