Skip to content

Commit

Permalink
Use actions/add-to-project
Browse files Browse the repository at this point in the history
  • Loading branch information
dbroeglin authored May 11, 2024
1 parent 97bbdd6 commit c2b17f8
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions .github/workflows/send_issues_to_triage.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
name: Add new issues to To triage column
on:
issues:
types: [opened]
types:
- opened

jobs:
add-to-project-column:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- name: Add issue to project column
uses: actions/github-script@v5
- uses: actions/add-to-project@1.0.1
with:
github-token: ${{ secrets.PROJECT_PAT }}
script: |
const issueNumber = context.issue.number;
const projectId = '1'; // Replace with your Project ID
const columnId = '2'; // Replace with your Column ID
// Get the issue
const { data: issue } = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
});
// Add the issue to the project column
await github.rest.projects.createCard({
column_id: columnId,
content_id: issue.id,
content_type: 'Issue',
});
project-url: https://github.com/users/dbroeglin/projects/1
github-token: ${{ secrets.PIKAICHU_PROJECT }}
labeled: needs-triage
label-operator: OR

0 comments on commit c2b17f8

Please sign in to comment.