Skip to content

Commit

Permalink
👥 add pr contributor workflow (umijs#2539)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored Jun 28, 2023
1 parent 30fa959 commit c007c70
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PullRequest Checker

on:
pull_request_target:
types:
- closed
paths-ignore:
- 'docs/**'

jobs:
read-file:
runs-on: ubuntu-latest
outputs:
require-result: ${{ steps.contributors.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Read contributors.json
id: contributors
uses: juliangruber/read-file-action@v1
with:
path: ./contributors.json

output-log:
runs-on: ubuntu-latest
needs: read-file
steps:
- name: contributors.json
run: echo "${{ needs.read-file.outputs.require-result }}"
- name: creator
run: echo "${{ github.event.pull_request.user.login }}"
- name: contains
run: echo "${{ contains(fromJSON(needs.read-file.outputs.require-result), github.event.pull_request.user.login) }}"
- name: merged
run: echo "${{ github.event.pull_request.merged }}"

check-merged:
runs-on: ubuntu-latest
needs: read-file
if: contains(fromJSON(needs.read-file.outputs.require-result), github.event.pull_request.user.login) == false && github.event.pull_request.merged == true
steps:
- uses: actions-cool/maintain-one-comment@v3
with:
body: 感谢 PR!如果有兴趣一起参与维护 Qiankun,可加入我们的 Qiankun Contributors 群。加入方式是先用钉钉扫下方二维码加我钉钉,记得注明 github id,然后我会拉你到群里。<br /><img src="https://mdn.alipayobjects.com/huamei_zvchwx/afts/img/A*beGTTId-5CMAAAAAAAAAAAAADuWEAQ/original" width="20%"/>
1 change: 1 addition & 0 deletions contributors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["kuitos", "gongshun"]

0 comments on commit c007c70

Please sign in to comment.