Skip to content

Commit

Permalink
Merge pull request #102 from WyriHaximus/Port-set-milestone-from-php-…
Browse files Browse the repository at this point in the history
…test-utilities
  • Loading branch information
WyriHaximus authored Aug 4, 2021
2 parents 31c881d + ca22a27 commit 0a1fb3e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/set-milestone-on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
- edited
- ready_for_review
- review_requested
env:
INITIAL_TAG: 1.0.0
FALLBACK_TAG: not_found
DEPENDABOT_APP_ID: 49699333
jobs:
set-milestone:
name: Set Milestone
Expand All @@ -21,17 +25,23 @@ jobs:
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
fallback: ${{ env.FALLBACK_TAG }}
- name: 'Get next versions'
id: semvers
if: steps.previoustag.outputs.tag != env.FALLBACK_TAG
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: 'Decide which version fits this PR'
id: decidedversion
run: |
if [ "$(jq '.sender.id' -r ${GITHUB_EVENT_PATH})" = "49699333" ]; then
if [ "${PREVIOUS_TAG}" = "${FALLBACK_TAG}" ]; then
printf "::set-output name=version::%s" "${INITIAL_TAG}"
exit 0
fi
if [ "$(jq '.sender.id' -r ${GITHUB_EVENT_PATH})" = "${DEPENDABOT_APP_ID}" ]; then
printf "::set-output name=version::%s" "${PATCH}"
exit 0
fi
Expand All @@ -45,6 +55,7 @@ jobs:
printf "::set-output name=version::%s" "${MINOR}"
env:
PREVIOUS_TAG: ${{ steps.previoustag.outputs.tag }}
MAJOR: ${{ steps.semvers.outputs.major }}
MINOR: ${{ steps.semvers.outputs.minor }}
PATCH: ${{ steps.semvers.outputs.patch }}
Expand All @@ -65,7 +76,7 @@ jobs:
- name: 'Create Milestone'
if: steps.querymilestone.outputs.number == ''
id: createmilestone
uses: "WyriHaximus/github-action-create-milestone@0.1.0"
uses: "WyriHaximus/github-action-create-milestone@v1"
with:
title: ${{ steps.decidedversion.outputs.version }}
env:
Expand Down

0 comments on commit 0a1fb3e

Please sign in to comment.