-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not reliably work when adding a commit to an existing deploy preview #6
Comments
Yeah @BrunnerLivio — you are completely right, and it's something that I've noticed as well. We could potentially create a solution for this by using the "commit" preview instead of the PR preview (every build in Netlify has a unique preview url) 🤔 |
Sounds great! @JakePartusch quite busy at the moment, but I'd love to investigate that as soon as I find some time. |
Hi forks Thanks yours hard work and great jobs I want to share my workaround. (I have tested several times, it's seems looks fine)
1. find out your "pull request's netlify's Pages changed checknamesteps
2. fill in your checkname (with single quote, bcuz checkName string have space)steps
and
finally
workflow yamlname: Successful Deploy Action Example
on: [pull_request]
jobs:
screenshots:
runs-on: ubuntu-latest
steps:
- name: Wait for Pages changed to neutral
uses: fountainhead/[email protected]
id: wait-for-Netlify
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
checkName: 'Pages changed - modest-spence-711b92'
- name: Get Preview URL and generate screenshot after Netlify check done
if: steps.wait-for-Netlify.outputs.conclusion == 'neutral'
uses: jakepartusch/wait-for-netlify-action@v1
id: waitFor200
with:
site_name: 'modest-spence-711b92' About "fountainhead/action-wait-for-check" Action
I chose 'Pages changed' as check target by intuition
The things I want to say isAs long as your netlify USE CASE become more COMPLICATE in the future
bcuz I am totally newbie in netlify, I just want to mention those things I not sure I have another newbie questionBefore I come here ("jakepartusch/wait-for-netlify-action"). I read a blog post. like this # .github/workflows/example_workflow.yml
name: Successful Deploy Action Example
on: deployment_status
jobs:
build:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- name: XYZ
run: npm run xyz
env:
DEPLOY_URL: ${{ github.event.deployment_status.target_url }} BUT I have tried lots of times. workflow NEVER be triggered by deployment_status (or deploymene) and
SO, I guess the blog post is Misleading (maybe only Zeit can work) FOR NOW, we can NOT trigger [deploymene, deployment_status] workflow via netlify Preview deploy, right ? thanks for your patient, hard work and great Github Actions !!! |
@flameddd thank you sooooo much for this workaround, i have spent a couple hours configuring this before I found this thread and configured it same as you did. I'm wondering if no one have proposed any other pro solution? |
I'd been meaning to create a PR or a work that reliably does a 'wait for netlify deploy on branch preview' but I haven't been getting around to it. If it's useful, this is the script I'm using that'll poll until it's ready. |
The following workflow does not reliably work with wait-for-netlify-action:
test
=> As expected
test
=> Not as expected
An easy fix to workaround this is sure with a simple sleep:
... but that is not really clean since we would need to update the sleep value every time the build step takes more or less time after changes.
The text was updated successfully, but these errors were encountered: