Switch v3 docs to default #178
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
# GitHub action that automatically adds newly filed issues to the Lit project. | |
# | |
# Based on the example at | |
# https://docs.github.com/en/issues/trying-out-the-new-projects-experience/automating-projects#example-workflow-authenticating-with-a-personal-access-token | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
add-issue-to-project: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
# Finds the global entity ID for the project and adds it to an environment variable | |
# for the next step to consume. | |
- name: Get project ID | |
env: | |
GITHUB_TOKEN: ${{ secrets.LIT_ROBOT_AUTOMATION_PAT }} | |
ORGANIZATION: lit | |
PROJECT_NUMBER: 4 | |
run: | | |
gh api graphql -f query=' | |
query($organization: String!, $project_number: Int!) { | |
organization(login: $organization){ | |
projectV2(number: $project_number) { | |
id | |
} | |
} | |
}' -f organization=$ORGANIZATION -F project_number=$PROJECT_NUMBER > project_data.json | |
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV | |
- name: Add issue to project | |
env: | |
GITHUB_TOKEN: ${{ secrets.LIT_ROBOT_AUTOMATION_PAT }} | |
ISSUE_ID: ${{ github.event.issue.node_id }} | |
run: | | |
gh api graphql -f query=' | |
mutation($project_id:ID!, $issue_id:ID!) { | |
addProjectV2ItemById(input: {projectId: $project_id, contentId: $issue_id}) { | |
item { | |
id | |
} | |
} | |
}' -f project_id=$PROJECT_ID -f issue_id=$ISSUE_ID |