wait-for-netlify-action icon indicating copy to clipboard operation
wait-for-netlify-action copied to clipboard

Action doesn't work for branch pushes

Open eli8levit opened this issue 5 years ago • 4 comments

Hi, I want to trigger an action when I push to dev branch without PR. In this case action build an url with undefined parameter:

image

Here is a file:

on: push
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [13.x]
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: Wait for the Netlify Preview
        uses: jakepartusch/wait-for-netlify-action@v1
        id: netlify
        with:
          site_name: 'brave-pasteur-***'
          max_timeout: 120
      - name: Audit URLs using Lighthouse
        uses: treosh/lighthouse-ci-action@v3
        with:
          urls: |
            ${{ steps.netlify.outputs.url }}
          uploadArtifacts: true

eli8levit avatar Jun 05 '20 09:06 eli8levit

I see an error ##[error]Action must be run in conjunction with the pull_request event but maybe it's possible to make for regular branch pushes too?

eli8levit avatar Jun 05 '20 12:06 eli8levit

Hey @jediyozh, what would be the expected url for this case?

JakePartusch avatar Jun 09 '20 13:06 JakePartusch

@JakePartusch I'm facing the same issue. Is it possible to trigger on pushes?

jithindasad avatar Sep 14 '20 15:09 jithindasad

Hi @jithindasad, the reason it doesn't work on push is because the "push" url is not deterministic (at least the last time I checked).

PR urls are based on the pull request number, so it is possible to determine what the url will be beforehand.

JakePartusch avatar Sep 14 '20 20:09 JakePartusch