Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 2a98d69

Browse files
taniandjerryTania Chakraborty
andauthored
Hacktoberfest 2024 Add take action to auto assign contributors (#300)
Co-authored-by: Tania Chakraborty <[email protected]>
1 parent 240f5ca commit 2a98d69

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/take.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Auto-assign issue to contributor
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
assign:
9+
name: Take an issue
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
steps:
14+
- name: Check if it's October
15+
id: check-month
16+
run: |
17+
current_month=$(date -u +%m)
18+
if [[ $current_month == "10" ]]; then
19+
echo "is_october=true" >> $GITHUB_OUTPUT
20+
else
21+
echo "is_october=false" >> $GITHUB_OUTPUT
22+
fi
23+
24+
- name: Take the issue
25+
if: steps.check-month.outputs.is_october == 'true'
26+
uses: bdougie/take-action@1439165ac45a7461c2d89a59952cd7d941964b87
27+
with:
28+
message: Thanks for taking this issue! Let us know if you have any questions!
29+
trigger: .take
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Log when outside October
33+
if: steps.check-month.outputs.is_october == 'false'
34+
run: echo "Action skipped because the current date is not in October."

0 commit comments

Comments
 (0)