Skip to content

Conversation

@LeZuse
Copy link
Contributor

@LeZuse LeZuse commented Aug 30, 2021

In combination with https://github.com/Khan/pull-request-comment-trigger you can completely customize when to run WPT on a PR.

Example:

on:
  pull_request:
    types: [opened]
  issue_comment:
    types: [created]

jobs:
  build:
    runs-on: ubuntu-latest
    name: WebPageTest Action
    steps:
      - uses: khan/pull-request-comment-trigger@master
        id: check
        with:
          trigger: '/wpt'
          reaction: rocket
          prefix_only: true
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

      - name: Checkout
        if: steps.check.outputs.triggered == 'true'
        uses: actions/checkout@v2
        
      - name: WebPageTest
        if: steps.check.outputs.triggered == 'true'
        uses: productboardlabs/webpagetest-github-action@pr-comment-trigger
        with:
          apiKey: ${{ secrets.WEBPAGETEST_API }}
          urls: |
            http://example.com
          label: 'GitHub Action Test'
          wptOptions: 'wpt-options.json'
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          

@tkadlec tkadlec merged commit b9717fb into catchpoint:main Aug 31, 2021
@tkadlec
Copy link
Contributor

tkadlec commented Aug 31, 2021

This looks great, @LeZuse! Thanks for adding this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants