File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,15 +32,27 @@ jobs:
3232 env :
3333 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3434
35- - name : Pull latest changes
35+ - name : Commit, Rebase and Push
3636 run : |
37+ # Configure Git
3738 git config --global user.name "github-actions[bot]"
3839 git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
39- git pull origin dev --rebase
4040
41- - name : Commit and Push Changes
42- uses : stefanzweifel/git-auto-commit-action@v5
43- with :
44- commit_message : " chore(devindex): Hourly index update [skip ci]"
45- file_pattern : " apps/devindex/resources/users.jsonl apps/devindex/resources/tracker.json"
46- branch : dev
41+ # Check for changes in specific files
42+ if [[ -n $(git status -s apps/devindex/resources/users.jsonl apps/devindex/resources/tracker.json) ]]; then
43+ echo "Changes detected in data files."
44+
45+ # Stage the files
46+ git add apps/devindex/resources/users.jsonl apps/devindex/resources/tracker.json
47+
48+ # Commit
49+ git commit -m "chore(devindex): Hourly index update [skip ci]"
50+
51+ # Rebase on top of remote changes to handle concurrent pushes
52+ git pull origin dev --rebase
53+
54+ # Push changes
55+ git push origin dev
56+ else
57+ echo "No changes detected. Skipping commit."
58+ fi
You can’t perform that action at this time.
0 commit comments