-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59ace0f
commit 4c80f70
Showing
2 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,40 @@ | ||
name: Update Contributors | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 1' # Runs every Monday at 00:00 UTC | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'README.md' | ||
|
||
jobs: | ||
update-contributors: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Update contributors | ||
uses: jakepartusch/all-contributors-action@v3 | ||
- name: Set Up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
node-version: '16' | ||
|
||
- name: Install All Contributors CLI | ||
run: npm install -g all-contributors-cli | ||
|
||
- name: Add Contributors | ||
run: all-contributors add $(git log --format='%aN <%aE>' | sort -u | awk '{print $1}' | sed 's/<//;s/>//') | ||
|
||
- name: Generate Contributors Section | ||
run: all-contributors generate | ||
|
||
- name: Commit and Push Changes | ||
run: | | ||
git config --local user.name "GitHub Action" | ||
git config --local user.email "action@github.com" | ||
git add README.md | ||
git commit -m "chore: update contributors list" || echo "No changes to commit" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters