From d63f9a092005e4aeb18adaec5b867a79c914e06c Mon Sep 17 00:00:00 2001 From: Juan Bustamante Date: Mon, 26 Jun 2023 17:28:58 -0500 Subject: [PATCH 1/2] WIP - initial version Signed-off-by: Juan Bustamante --- .github/workflows/privileged-pr-process.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/privileged-pr-process.yml b/.github/workflows/privileged-pr-process.yml index b1bcd376c5..088d4aa49b 100644 --- a/.github/workflows/privileged-pr-process.yml +++ b/.github/workflows/privileged-pr-process.yml @@ -19,6 +19,17 @@ jobs: id: assets with: script: | + var current = await github.rest.issues.get({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.number, + }) + .then(result => result.milestone) + + if (current) { + console.log(`Issue already has a milestone assigned, skipping add milestone step`); + } + var milestone = await github.rest.issues.listMilestones({ owner: context.repo.owner, repo: context.repo.repo, From d163a95fa0283fcb001ea65119169c78f924ded4 Mon Sep 17 00:00:00 2001 From: Juan Bustamante Date: Wed, 7 Feb 2024 17:33:03 -0500 Subject: [PATCH 2/2] skipping the process to assign a milestone when the issue already has one Signed-off-by: Juan Bustamante --- .github/workflows/privileged-pr-process.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/privileged-pr-process.yml b/.github/workflows/privileged-pr-process.yml index 088d4aa49b..41fcee8e2e 100644 --- a/.github/workflows/privileged-pr-process.yml +++ b/.github/workflows/privileged-pr-process.yml @@ -28,6 +28,7 @@ jobs: if (current) { console.log(`Issue already has a milestone assigned, skipping add milestone step`); + return } var milestone = await github.rest.issues.listMilestones({