Skip to content

Commit

Permalink
Create 99-add-issue-to-project.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranzke authored Dec 11, 2024
1 parent d1090a6 commit d3fb4b8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/99-add-issue-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Add Issue to Project

on:
issues:
types: [opened]

jobs:
add_to_project:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Add issue to GitHub Project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Define GitHub Project ID and retrieve issue number
PROJECT_ID="8"
ISSUE_NUMBER="${{ github.event.issue.number }}"
# GitHub API-call to add the issue to your project
curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.inertia-preview+json" \
-d "{\"content_type\": \"Issue\", \"content_id\": $ISSUE_NUMBER}" \
"https://api.github.com/projects/columns/cards?project_id=$PROJECT_ID"

0 comments on commit d3fb4b8

Please sign in to comment.