test1 #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Add Issue to Project | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
add-issue-to-project: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Add issue to project | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PROJECT_ID: ${{ secrets.DEV_PROJECT_ID }} # Set this in your repository secrets | |
run: | | |
issue_number=${{ github.event.issue.number }} | |
issue_node_id=$(gh api graphql -F owner='${{ github.repository_owner }}' -F name='${{ github.event.repository.name }}' -f query=' | |
query ($owner: String!, $name: String!, $issueNumber: Int!) { | |
repository(owner: $owner, name: $name) { | |
issue(number: $issueNumber) { | |
id | |
} | |
} | |
}' -q .data.repository.issue.id) | |
gh api graphql -F projectId=$PROJECT_ID -F contentId=$issue_node_id -f query=' | |
mutation ($projectId: ID!, $contentId: ID!) { | |
addProjectNextItem(input: {projectId: $projectId, contentId: $contentId}) { | |
projectNextItem { | |
id | |
} | |
} | |
}' |