From 5d0ff662b91b34da9235f2da2edf726e3c36a1f7 Mon Sep 17 00:00:00 2001 From: Dinesh Talwadker Date: Sun, 28 Jul 2024 12:04:49 +0530 Subject: [PATCH] create add-contributor-on-issue.yml --- .../workflows/add-contributor-on-issue.yml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/add-contributor-on-issue.yml diff --git a/.github/workflows/add-contributor-on-issue.yml b/.github/workflows/add-contributor-on-issue.yml new file mode 100644 index 00000000..e091cd3d --- /dev/null +++ b/.github/workflows/add-contributor-on-issue.yml @@ -0,0 +1,33 @@ +name: Add Contributor on Issue + +on: + issues: + types: [opened] + +jobs: + add-contributor: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Run script to add contributor + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + npm install -g jsonfile + node .github/scripts/addContributor.js "${{ github.event.issue.user.login }}" "${{ github.event.issue.body }}" + + - name: Commit and push changes + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add . + git commit -m "Add contributor: ${{ github.event.issue.user.login }}" + git push