File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Update Credits upon opening PR
2
+
3
+ on :
4
+ pull_request :
5
+ types :
6
+ - opened
7
+ - synchronize
8
+
9
+ jobs :
10
+ update-credits :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout Repository
15
+ uses : actions/checkout@v2
16
+
17
+ - name : Update Credits
18
+ run : |
19
+ contributor_name=$(jq -r '.pull_request.user.login' $GITHUB_EVENT_PATH)
20
+ pr_description=$(jq -r '.pull_request.body' $GITHUB_EVENT_PATH)
21
+
22
+ echo "### Timestamp:" >> credits.md
23
+ echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> credits.md
24
+ echo "### Contributor:" >> credits.md
25
+ echo "${{ github.event.pull_request.user.login }}" >> credits.md
26
+ echo "#### PR Title:" >> credits.md
27
+ echo "${{ github.event.pull_request.title }}" >> credits.md
28
+ echo "############################################" >> credits.md
29
+
30
+ git add credits.md
31
+ git config --local user.email "[email protected] "
32
+ git config --local user.name "GitHub Action"
33
+ git commit -m "Update credits.md with contributor information" || exit 0
34
+ git push
35
+ env :
36
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments