diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml new file mode 100644 index 00000000..1a86ddf4 --- /dev/null +++ b/.github/workflows/contributors.yml @@ -0,0 +1,33 @@ +name: contributors + +on: + pull_request: + branches: + - main + +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: lts/* + - name: Contributors + run: | + git config --global user.email ${{ secrets.GIT_EMAIL }} + git config --global user.name ${{ secrets.GIT_USERNAME }} + npm run contributors + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GH_TOKEN }} + branch: ${{ github.head_ref }} diff --git a/package.json b/package.json index be885e88..e82448e6 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,14 @@ "name": "Balázs Orbán", "email": "info@balazsorban.com" }, - { - "name": "nkzawa", - "email": "naoyuki.kanezawa@gmail.com" - }, { "name": "feugy", "email": "damien@vercel.com" }, + { + "name": "nkzawa", + "email": "naoyuki.kanezawa@gmail.com" + }, { "name": "Lee Robinson", "email": "me@leerob.io" @@ -110,7 +110,7 @@ "clean": "pnpm -r run clean && rm -rf ./node_modules", "clean:build": "pnpm -r run clean:build", "clean:node": "pnpm -r run clean:node", - "contributors": "git-authors-cli && finepack", + "contributors": "(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true", "coverage": "c8 report --reporter=text-lcov > coverage/lcov.info", "lockfile": "pnpm install --lockfile && git add pnpm-lock.yaml && git commit -m \"build: regenerate lock\"", "postinstall": "./node_modules/.bin/simple-git-hooks",