Skip to content

Commit

Permalink
adding branch & merge
Browse files Browse the repository at this point in the history
  • Loading branch information
caesarw0 committed Sep 9, 2023
1 parent 5041f84 commit 586be75
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/update_csv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
echo "CSV file is not empty."
else
echo "CSV file is empty."
exit 78
exit 1
fi
- name: Check for Differences
Expand All @@ -50,9 +50,21 @@ jobs:
- name: Commit and Push Changes
if: steps.check-csv.outcome == 'success' && env.DIFFERENT_CSV == 'true'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
timestamp=$(date +'%Y%m%d%H%M%S')
branch_name="update-csv-$timestamp"
git checkout -b "$branch_name"
git add data/childcare_locations.csv
git commit -am "Update CSV file"
git push
git commit -m "Update CSV file"
git push origin "$branch_name"
git checkout main
git merge --no-ff "$branch_name"
git push origin main
# delete the temporary branch
git branch -d "$branch_name"
git push origin --delete "$branch_name"

0 comments on commit 586be75

Please sign in to comment.