Skip to content

Commit

Permalink
Create IssueToNewProjectItem.yml
Browse files Browse the repository at this point in the history
shining-man authored Aug 7, 2024
1 parent c2b6754 commit ea43520
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/IssueToNewProjectItem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Create Project Item on Issue Creation

on:
issues:
types: [opened]

jobs:
create_project_item:
runs-on: ubuntu-latest
steps:
- name: Create Project Item
env:
GH_TOKEN: ${{ secrets.PROJECT_TOKEN }}
PROJECT_ID: "PVT_kwHOBos2JM4AlrcP" # Projekt-ID
run: |
ISSUE_NODE_ID=$(gh api graphql -F issue_number=${{ github.event.issue.number }} -F owner="${{ github.repository_owner }}" -F name="${{ github.event.repository.name }}" -f query='
query($issue_number: Int!, $owner: String!, $name: String!) {
repository(owner: $owner, name: $name) {
issue(number: $issue_number) {
id
}
}
}' --jq '.data.repository.issue.id')
gh api graphql -F projectId="$PROJECT_ID" -F contentId="$ISSUE_NODE_ID" -f query='
mutation($projectId: ID!, $contentId: ID!) {
addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) {
item {
id
}
}
}'

0 comments on commit ea43520

Please sign in to comment.