From acb214d0928f9aed16fee43e0d6ecbd9a60b429b Mon Sep 17 00:00:00 2001 From: Fr_Dae Date: Tue, 5 Sep 2023 16:45:56 +0200 Subject: [PATCH] test03 workflow - add projet on issues test03 workflow - add projet on issues --- .github/workflows/todo.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/todo.yml b/.github/workflows/todo.yml index f73f814..c11b1ac 100644 --- a/.github/workflows/todo.yml +++ b/.github/workflows/todo.yml @@ -1,4 +1,4 @@ -name: Assign "à faire" Label to New Issues +name: Ajouter une nouvelle issue à la backlog on: issues: @@ -6,19 +6,20 @@ on: - opened jobs: - assign-label: + add_to_backlog: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Add "🆕 A Faire" label - run: | - ISSUE_NUMBER=$(jq --raw-output .issue.number "$GITHUB_EVENT_PATH") - echo "Adding 'à faire' label to issue #$ISSUE_NUMBER" - gh issue edit $ISSUE_NUMBER --add-label "à faire" - - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_NUMBER: ${{ github.event.issue.number }} + - name: Ajouter l'issue à la backlog + uses: actions/github-script@v4 + with: + script: | + const backlogProjectId = 1; + const issueNumber = context.payload.issue.number; + + const octokit = github.getOctokit(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); + octokit.projects.createCard({ + column_id: backlogProjectId, + content_id: issueNumber, + content_type: "Issue" + }); \ No newline at end of file