Skip to content

Commit

Permalink
update the ci-cd, main.yml file to run the comit and push command onl…
Browse files Browse the repository at this point in the history
…y if changes are detected using git status --porcelain option (#201)

Co-authored-by: antoineMerleEUM <antoine.merle@eumetsat.int>
  • Loading branch information
amilan17 and antoinemerle authored May 29, 2024
1 parent 1e9b545 commit cfb2ba9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ jobs:
ls xml
git config --global user.email "efucile@wmo.int"
git config --global user.name "Enrico Fucile"
git branch
git add .
git commit -m "xml files" -a
git push
git branch
# Use of status --pocelain to check if files have been changed or not
# If changes commit and push
if [[ `git status --porcelain` ]]; then
git add .
git commit -m "xml,txt files" -a
git push
# if not, only print a message saying not commit
else
echo "No changes to commit"
fi

0 comments on commit cfb2ba9

Please sign in to comment.