Skip to content
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

Composite :) #2

Merged
merged 3 commits into from Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions Dockerfile

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
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
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.