From 0b887637fcaf5234b2b87c8e9b431306e58bf211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sat, 28 Sep 2024 22:03:57 +0000 Subject: [PATCH] Do not run steps if a milestone is already set --- .github/workflows/milestones.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/milestones.yml b/.github/workflows/milestones.yml index 7d8d98dc776..84708f6dc38 100644 --- a/.github/workflows/milestones.yml +++ b/.github/workflows/milestones.yml @@ -74,6 +74,7 @@ jobs: run: echo "PR does not have a milestone" if: ${{ !steps.current-milestone.outputs.milestone}} - name: Get VERSION file + if: ${{ !steps.current-milestone.outputs.milestone}} id: version-file run: | echo "version<> "${GITHUB_OUTPUT}" @@ -86,10 +87,12 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} - name: Show version file + if: ${{ !steps.current-milestone.outputs.milestone}} run: echo $VERSIONFILE env: VERSIONFILE: ${{ steps.version-file.outputs.version}} - name: Get milestone title from VERSION file + if: ${{ !steps.current-milestone.outputs.milestone}} id: milestone run: | version=$(echo "$VERSIONFILE" | head -n 3 | xargs | sed 's/ /./g' | sed 's/\(RC\|dev\)//g') @@ -97,10 +100,13 @@ jobs: env: VERSIONFILE: ${{ steps.version-file.outputs.version}} - name: Show milestone title + if: ${{ !steps.current-milestone.outputs.milestone}} run: echo $MILESTONE env: MILESTONE: ${{ steps.milestone.outputs.title }} - - run: gh pr edit ${{ github.event.pull_request.html_url }} --milestone "${MILESTONE}" + - name: Set PR milestone + if: ${{ !steps.current-milestone.outputs.milestone}} + run: gh pr edit ${{ github.event.pull_request.html_url }} --milestone "${MILESTONE}" env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }}