JakePartusch / wait-for-netlify-action

A GitHub action that will wait until a Netlify Preview deploy has completed before continuing on
MIT License
47 stars 52 forks source link

Action doesn't work for branch pushes #8

Open eli8levit opened 4 years ago

eli8levit commented 4 years ago

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 commented 4 years ago

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?

JakePartusch commented 4 years ago

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

jithindasad commented 4 years ago

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

JakePartusch commented 4 years ago

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.