Skip to content

Commit 015bdbe

Browse files
authored
Merge pull request #58 from Akshay-Dongare/akshay
Fixed issue #53
2 parents a396447 + da1de06 commit 015bdbe

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/assign_action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: contributor-takes-action
2+
description: This is an action to assign yourself to an issue for a repo you are not a contributor to.
3+
author: Akshay Dongare
4+
branding:
5+
icon: 'thumbs-up'
6+
color: 'white'
7+
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
-
13+
run: |
14+
BODY="$(jq '.comment.body' $GITHUB_EVENT_PATH)"
15+
ISSUE_NUMBER="$(jq '.issue.number' $GITHUB_EVENT_PATH)"
16+
LOGIN="$(jq '.comment.user.login' $GITHUB_EVENT_PATH | tr -d \")"
17+
REPO="$(jq '.repository.full_name' $GITHUB_EVENT_PATH | tr -d \")"
18+
if [[ $BODY == *"/assign"* ]]; then
19+
echo "Assigning issue $ISSUE_NUMBER to $LOGIN"
20+
echo "Using the link: https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees"
21+
curl -H "Authorization: token $GITHUB_TOKEN" -d '{"assignees":["'"$LOGIN"'"]}' https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees
22+
fi
23+
shell: bash

0 commit comments

Comments
 (0)