Skip to content

Commit

Permalink
Implement condition with shell if
Browse files Browse the repository at this point in the history
  • Loading branch information
Baschdl committed Jan 30, 2024
1 parent 8b2bb44 commit 39ce640
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/push_to_overleaf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ jobs:
ls -lah
ls -lah labproject/
cp labproject/plots/* overleaf/figures/
- name: Setup overleaf git and add changes
- name: Commit and push changes to Overleaf
run: |
cd ${{ github.workspace }}
cd ../overleaf/
git config --global user.name "Github Actions"
git config --global user.email ""
git add figures/
- name: Commit and push changes to Overleaf if new figures were produced
if: ${{ git diff --cached --exit-code }}
run: |
git commit -m "Update figures automatically"
git push
if [ -z "$(git status --untracked-files=no --porcelain)" ]; then
echo "No changes to commit";
else
git commit -m "Update figures automatically"
git push
fi

0 comments on commit 39ce640

Please sign in to comment.