Skip to content

[Add] My First PR

[Add] My First PR #32

name: Auto assign & Label
on:
issues:
types: [opened]
jobs:
auto-assign:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
# From Github marketplace: https://github.com/marketplace/actions/auto-assign-issue
- name: 'Auto-assign issue'
uses: pozil/auto-assign-issue@v1
with:
assignees: juanPabloDiaz
numOfAssignee: 1
allowSelfAssign: true
- name: Check issue title for 'add' keyword and add good first issue label
if: contains(github.event.issue.title, 'add')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
issue_number=$(jq -r '.issue.number' "$GITHUB_EVENT_PATH")
labels='["good first issue"]'
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${issue_number}/labels \
-d "$labels"