Skip to content

Commit

Permalink
Commits or amends based on the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MavikBow committed Dec 29, 2024
1 parent efbd22b commit 0507e63
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/daily-download-scraper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ jobs:
git checkout main
git checkout automation -- download_data.json README.md
git add download_data.json README.md
git commit --fixup-amend::/"daily sync of download related data from automation branch"
git rebase --autosquash
git push origin main
- name: Commit or amend
run: |
log_mes=$(git log --oneline --pretty="%an %s" | head -n 1)
committer=$(echo "$log_mes" | awk '{print $1}')
commit_mes=$(echo "$log_mes" | awk '{$1=""; print $0}' | sed 's/^ *//g')
if [[ $committer == 'github-actions' && $commit_mes == 'daily sync download data from automation branch' ]]; then
git commit --amend
git push --force
else
git commit -m "daily sync download data from automation branch"
git push
fi

0 comments on commit 0507e63

Please sign in to comment.