Skip to content

Commit

Permalink
Do not run steps if a milestone is already set
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix committed Sep 28, 2024
1 parent 0ef5931 commit 0b88763
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/milestones.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF" >> "${GITHUB_OUTPUT}"
Expand All @@ -86,21 +87,26 @@ 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')
echo "title=$version" >> "${GITHUB_OUTPUT}"
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 }}
Expand Down

0 comments on commit 0b88763

Please sign in to comment.