Skip to content

Commit 9f08596

Browse files
authored
Merge 743a21f into 365d6ef
2 parents 365d6ef + 743a21f commit 9f08596

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/workflows/credits.md

Whitespace-only changes.

.github/workflows/update-credits.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 }}

0 commit comments

Comments
 (0)