소스 검색

Merge pull request #109 from adswa/tributors

Add a tributors workflow to recognize contributors and also say hi
Michael Hanke 1 년 전
부모
커밋
de2d66e995
2개의 변경된 파일114개의 추가작업 그리고 0개의 파일을 삭제
  1. 28 0
      .github/config.yml
  2. 86 0
      .github/workflows/update-contributors.yml

+ 28 - 0
.github/config.yml

@@ -0,0 +1,28 @@
+# Configuration for welcome - https://github.com/behaviorbot/welcome
+
+# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
+
+# Comment to be posted to on first time issues
+newIssueWelcomeComment: >
+  ![Welcome Banner](https://zenodo.org/api/iiif/v2/0c0188d3-d03c-4830-a6e3-00405f5c22fa:8ff47a85-7250-4d86-8e48-2f346b48b2c1:BannerWelcome.jpg/full/750,/0/default.jpg)
+  (Image: CC-BY license, The Turing Way Community, & Scriberia. Zenodo. http://doi.org/10.5281/zenodo.3332808)
+  Hi there, and thank you for filing an issue. We're excited to have your input and welcome your idea! :blush:
+
+# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
+
+# Comment to be posted to on PRs from first time contributors in your repository
+newPRWelcomeComment: >
+  ![Thank You Banner](https://zenodo.org/api/iiif/v2/0c0188d3-d03c-4830-a6e3-00405f5c22fa:7fbd97cf-283b-480c-b8e1-11866e26245c:BannerThanks.jpg/full/750,/0/default.jpg)
+  (Image: CC-BY license, The Turing Way Community, & Scriberia. Zenodo. http://doi.org/10.5281/zenodo.3332808)
+  Wohoo! :tada: Thanks for opening your first pull request! :sunglasses:
+  We really appreciate your time and effort to contribute to the project - you're amazing! :clap:
+
+# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
+
+# Comment to be posted to on pull requests merged by a first time user
+firstPRMergeComment: >
+  ![Congratulations Banner](https://zenodo.org/api/iiif/v2/0c0188d3-d03c-4830-a6e3-00405f5c22fa:32fbdb89-ae1b-434e-830c-88ade86724cc:BannerCongratulations.jpg/full/750,/0/default.jpg)
+  (Image: CC-BY license, The Turing Way Community, & Scriberia. Zenodo. http://doi.org/10.5281/zenodo.3332808)
+  Congrats on merging your first pull request! :tada:
+  The DataLad Team appreciates your contribution greatly, and we want to say thanks! :sparkling_heart:
+  Now go ahead and share your first merge with your colleagues, you got yourself this brag right! :smile: :gift:

+ 86 - 0
.github/workflows/update-contributors.yml

@@ -0,0 +1,86 @@
+name: allcontributors-auto-detect
+
+on:
+  push:
+    branches:
+      - main
+
+jobs:
+  Update:
+    name: Generate
+    runs-on: ubuntu-latest
+    if: contains(github.repository, 'datalad/datalad-gooey')
+    steps:
+      - name: Checkout Repository
+        uses: actions/checkout@v2
+
+      - name: Tributors Update
+        uses: con/tributors@0.0.19
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+
+          # Single text list (space separated) of parsers, leave unset to auto-detect
+          parsers: unset
+
+          # Update lookup with GitHub metadata
+          update_lookup: github
+
+          # Skip these users (example)
+          #skip_users: manbat bhanuprasad14 yetanothertestuser bobknob23987
+
+          # INFO, DEBUG, ERROR, WARNING, etc.
+          log_level: DEBUG
+
+          # If files already exist and an init is done, force overwrite
+          force: true
+
+          # the minimum number of contributions required to add a user
+          threshold: 1
+
+      - name: Checkout New Branch
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          BRANCH_AGAINST: "main"
+        run: |
+          printf "GitHub Actor: ${GITHUB_ACTOR}\n"
+          export BRANCH_FROM="contributors/update-$(date '+%Y-%m-%d')"
+          git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
+
+          BRANCH_EXISTS=$(git ls-remote --heads origin ${BRANCH_FROM})
+          if [[ -z ${BRANCH_EXISTS} ]]; then
+              printf "Branch does not exist in remote.\n"
+          else
+              printf "Branch already exists in remote.\n"
+              exit 1
+          fi
+          git branch
+          git checkout -b "${BRANCH_FROM}" || git checkout "${BRANCH_FROM}"
+          git branch
+
+          git config --global user.name "github-actions"
+          git config --global user.email "github-actions@users.noreply.github.com"
+          git status
+
+          if git diff-index --quiet HEAD --; then
+             export OPEN_PULL_REQUEST=0
+             printf "No changes\n"
+          else
+             export OPEN_PULL_REQUEST=1
+             printf "Changes\n"
+             git commit -a -m "Automated deployment to update contributors $(date '+%Y-%m-%d')
+
+          [skip ci]"
+             git push origin "${BRANCH_FROM}"
+          fi
+          echo "OPEN_PULL_REQUEST=${OPEN_PULL_REQUEST}" >> $GITHUB_ENV
+          echo "PULL_REQUEST_FROM_BRANCH=${BRANCH_FROM}" >> $GITHUB_ENV
+          echo "PULL_REQUEST_TITLE=[tributors] ${BRANCH_FROM}" >> $GITHUB_ENV
+          echo "PULL_REQUEST_BODY='Tributors update automated pull request.\n\n[skip ci]'" >> $GITHUB_ENV
+
+      - name: Open Pull Request
+        uses: vsoch/pull-request-action@1.0.17
+        if: ${{ env.OPEN_PULL_REQUEST == '1' }}
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          PULL_REQUEST_BRANCH: "main"