-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
scripts/deploy.sh: exit immediately if there aren't any changes #11836
Conversation
* clean up the script
Agreed, we could probably document them here https://github.com/tldr-pages/tldr/tree/main/scripts/README.md and update the scripts to have a consistent style. |
https://github.com/kbdkorg/tldr/actions/runs/7323410823/workflow - name: Build PDF
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
working-directory: ./scripts/pdf
run: bash build-pdf.sh
- name: Deploy
if: github.repository == 'tldr-pages/tldr' && github.ref == 'refs/heads/main'
run: bash scripts/deploy.sh
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} You are checking 3 commits were merged into |
@acuteenvy Thanks for pointing it out, I am extremely sorry for the mishap forgot to remove the lines (while testing). |
No problem. I don't think there's even a way to tell GitHub to skip the next step using shell commands in the previous one. I think we could prevent this from happening in the future if we put the deployment steps in a different file without |
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.
Tested the changes (it works fine). Thanks for the fixes.
Separating the CI for commits to |
I normally let the previous step return an exit code of 1, this will skip the next steps, but if you want A, maybe skip B, but always C, you can specify |
Let's add it to the Tracker (for 2024?) |
#11825 (comment) didn't work because it did the opposite - exit when there are changes, proceed if there aren't. I forgot to add a
!
.I removed some of the variables used only once, because their contents were shorter than the variable name itself.
By the way, it would be great if we had some written conventions regarding the shell scripts.
$var
, some${var}