Skip to content

Commit cb41790

Browse files
committed
use gh action
1 parent 9e62541 commit cb41790

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

.github/workflows/cron.yaml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
jobs:
1111
clean:
1212
runs-on: ubuntu-latest
13+
permissions:
14+
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
15+
contents: write
1316

1417
steps:
1518
- uses: actions/checkout@v4
@@ -37,30 +40,7 @@ jobs:
3740
SPONSORKIT_OPENCOLLECTIVE_SLUG: ${{ secrets.SPONSORKIT_OPENCOLLECTIVE_SLUG }}
3841
SPONSORKIT_OPENCOLLECTIVE_KEY: ${{ secrets.SPONSORKIT_OPENCOLLECTIVE_KEY }}
3942

40-
- name: Check for changes
41-
id: check-changes
42-
run: |
43-
echo "Current working directory:"
44-
pwd
45-
echo "Files in current directory:"
46-
ls -la
47-
echo "Git status output:"
48-
git status --porcelain
49-
echo "All git status (including untracked):"
50-
git status --porcelain --untracked-files=all
51-
if [[ -n "$(git status --porcelain --untracked-files=all)" ]]; then
52-
echo "changes=true" >> $GITHUB_OUTPUT
53-
echo "Changes detected!"
54-
else
55-
echo "changes=false" >> $GITHUB_OUTPUT
56-
echo "No changes detected"
57-
fi
58-
59-
- name: Commit and push if changed
60-
if: steps.check-changes.outputs.changes == 'true'
61-
run: |
62-
git config --global user.name 'github-actions[bot]'
63-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
64-
git add -A
65-
git commit -m "chore: generate definition file [skip ci]"
66-
git push
43+
- name: Git Auto Commit
44+
uses: EndBug/add-and-commit@v9
45+
with:
46+
message: "chore: update generated files"

0 commit comments

Comments
 (0)