Skip to content

feat: Added workflow for better Recognize/Credit Contributors #1602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/credits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Timestamp:
2023-11-20T17:17:05Z
### Contributor:
qcdyx
#### PR Number:
1602
#### PR Title:
feat: Added workflow for better Recognize/Credit Contributors
########################################################################################x
### Timestamp:
2023-11-20T20:09:14Z
### Contributor:
qcdyx
#### PR Number:
1602
#### PR Title:
feat: Added workflow for better Recognize/Credit Contributors
########################################################################################x
35 changes: 35 additions & 0 deletions .github/workflows/update_credits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Update Credits upon creating PR

on:
pull_request:
branches:
- master
types:
- opened
- synchronize

jobs:
update-credits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- run: |
echo "### Timestamp:" >> .github/credits.md
echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> .github/credits.md
echo "### Contributor:" >> .github/credits.md
echo "${{ github.event.pull_request.user.login }}" >> .github/credits.md
echo "#### PR Number:" >> .github/credits.md
echo "${{ github.event.pull_request.number }}" >> .github/credits.md
echo "#### PR Title:" >> .github/credits.md
echo "${{ github.event.pull_request.title }}" >> .github/credits.md
echo "########################################################################################x" >> .github/credits.md

git add .github/credits.md
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Update credits.md with contributor information"
git push origin ${{ github.event.pull_request.head.ref}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}