Skip to content

Commit

Permalink
Merge pull request #2 from crazy-max/main
Browse files Browse the repository at this point in the history
Composite :)
  • Loading branch information
bdougie committed Sep 22, 2020
2 parents bde1ccf + 187a838 commit 1735275
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
4 changes: 0 additions & 4 deletions Dockerfile

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This GitHub Action pins an issue based on a specified label.

## Setup

```yml
```yaml
# .github/workflows/take.yml
name: Assign issue to contributor
on:
Expand All @@ -21,4 +21,6 @@ jobs:
steps:
- name: take the issue
uses: bdougie/take-action@main
env:
GITHUB_TOKEN: ${{ github.token }}
```
19 changes: 17 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ author: Brian Douglas
branding:
icon: 'thumbs-up'
color: 'white'


runs:
using: 'docker'
image: 'Dockerfile'
using: "composite"
steps:
-
run: |
BODY="$(jq '.comment.body' $GITHUB_EVENT_PATH)"
ISSUE_NUMBER="$(jq '.issue.number' $GITHUB_EVENT_PATH)"
LOGIN="$(jq '.comment.user.login' $GITHUB_EVENT_PATH | tr -d \")"
REPO="$(jq '.repository.full_name' $GITHUB_EVENT_PATH | tr -d \")"
if [[ $BODY == *".take"* ]]; then
echo "Assigning issue $ISSUE_NUMBER to $LOGIN"
echo "Using the link: https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees"
curl -H "Authorization: token $GITHUB_TOKEN" -d '{"assignees":["'"$LOGIN"'"]}' https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees
fi
shell: bash
12 changes: 0 additions & 12 deletions entrypoint.sh

This file was deleted.

0 comments on commit 1735275

Please sign in to comment.