-
Notifications
You must be signed in to change notification settings - Fork 41
Avoid failures when cleaning docs #262
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
Conversation
| env: | ||
| PRNUM: ${{ github.event.number }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you want to delete that 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha no 😄
| - name: Delete preview and history + push changes | ||
| run: | | ||
| git push --force origin gh-pages-new:gh-pages | ||
| if [ -d "previews/PR$PRNUM" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also where does the [ -d ] syntax comes from? I could not find anything in the docs...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just bash syntax. It checks if the folder actually exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
|
Let's see if it works as expected the next time someone opens a PR from a forked repository. |
|
At least it worked for this PR, so we didn't break the existing setup 🙂 |
This PR should make the cleanup action a bit safer. Currently it fails if the preview does not exist, e.g., if a PR is opened from a fork (e.g., #261).