Remove Projects CI #52
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: | |
track_issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get project data | |
run: | | |
# shellcheck disable=SC2016 | |
gh api graphql -f query=' | |
query getProjectId($org: String!, $number: Int!) { | |
organization(login: $org) { | |
projectV2(number: $number) { | |
id | |
title | |
} | |
} | |
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json | |
echo "PROJECT_ID=$(jq '.data.organization.projectV2.id' project_data.json)" >> "$GITHUB_ENV" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PROJECT_TOKEN }} | |
ORGANIZATION: VikeSec | |
PROJECT_NUMBER: 2 | |
- name: Add issue to project | |
run: | | |
# shellcheck disable=SC2016 | |
gh api graphql -f query=' | |
mutation addIssueToProject($project:ID!, $issue:ID!) { | |
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) { | |
clientMutationId | |
} | |
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PROJECT_TOKEN }} | |
ISSUE_ID: ${{ github.event.issue.node_id }} |