-
Notifications
You must be signed in to change notification settings - Fork 119
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
3a799c3
commit 7e1a601
Showing
1 changed file
with
0 additions
and
36 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,36 +0,0 @@ | ||
name: Add Contributors | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
add-contributor: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install all-contributors-cli | ||
run: npm install -g all-contributors-cli | ||
|
||
- name: Configure git | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
- name: Add contributor | ||
run: | | ||
CONTRIBUTOR=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH") | ||
npx all-contributors-cli add $CONTRIBUTOR code,doc | ||
npx all-contributors-cli generate | ||
git add . | ||
git commit -m "docs: add @$CONTRIBUTOR as a contributor for code, doc" | ||
git push | ||