-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Status check #10
Comments
Hey @tpluscode ! Thanks for your comment! If i understand correctly you would like to use this action on a PR to create previews? |
Yes, makes total sense. The thing is that in this particular repo I'm not in fact using Netlify for deployment but I found your action so that I can have previews without changing much. What about the |
Hey @tpluscode , can we close this issue since your PRs were merged ? |
Maybe. The PR check could be created using a separate action. Probably does not belong here anyway. I was only thinking to maybe output the deployed URL. Do you know if |
Hum you're right, we could check the exit code and create a GitHub action's output, which could then be picked oup by something like https://github.com/marketplace/actions/status-update |
Following an arduous trial and error process, I landed this workflow which combines your action with a status check. I will create a PR with example usage. An action input would allow changing the last line so that manually constructing the preview would be unnecessary. Maybe not worth the effort, especially if Netlify does not give away that information? |
I'm not sure what last line you are referring to, but i believe that Netlify's integration is webhook based, so they can create th status checks with the URL from their server. Their CLI is open source as well, I'm guessig there is a way to fetch the deployed url and expose it from there |
Hey, I just noticed that the latest version has outputs and I tried to use them for the status check. For some reason that did not work Does this look correct? - name: Publish preview
+ id: netlify
uses: jsmrcaga/[email protected]
if: env.NETLIFY_AUTH_TOKEN
with:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_DEPLOY_MESSAGE: Preview ${{ env.BRANCH_NAME }}
build_directory: dist
deploy_alias: ${{ env.BRANCH_NAME }}
NETLIFY_DEPLOY_TO_PROD: false
- name: Status check
uses: Sibz/[email protected]
if: env.NETLIFY_AUTH_TOKEN
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: Netlify Site
state: success
- target_url: https://${{ env.BRANCH_NAME }}--shacl-playground.netlify.app
+ target_url: ${{ steps.netlify.outputs.NETLIFY_PREVIEW_URL }} |
Oh, |
It would be nice to have a status check created on a PR. While I see that the netlify CLI does not return the preview URL in a way easy to retrieve, I would propose to use the
--alias
optionWith a stable URL such as
https://${branchName}.foo-bar-baz.netlify.app
it would then be possible to use GitHub API to create the status checkThe text was updated successfully, but these errors were encountered: