Skip to content

Commit

Permalink
[github] auto milestone, fix increase step, try again with bool
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 10, 2020
1 parent d73f745 commit b4b4338
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/pr-auto-milestone.yml
Expand Up @@ -87,7 +87,8 @@ jobs:
MAX_RELEASE=$(echo "${JSON_DATA}" | jq ".repository.refs.edges[].node.name | select( . | test(\"^final-${QGIS_MAJOR_VERSION}${MINOR_VERSION}\") ) | sub(\"^final-${QGIS_MAJOR_VERSION}_(?<m>[0-9]+)_(?<p>.)\"; .m+\".\"+.p) | tonumber" | jq -s '. | max')
echo "MAX_RELEASE: ${MAX_RELEASE}"
MILESTONE_TITLE="${QGIS_MAJOR_VERSION}."$(echo "${MAX_RELEASE} + 0.1 " | bc)
INCREASE_STEP=$([[ -z ${MINOR_VERSION} ]] && echo "2.0" || echo "0.1" )
MILESTONE_TITLE="${QGIS_MAJOR_VERSION}."$(echo "${MAX_RELEASE} + ${INCREASE_STEP} " | bc)
echo "MILESTONE_TITLE: ${MILESTONE_TITLE}"
MILESTONE_NUMBER=$(echo "${JSON_DATA}" | jq ".repository.milestones.edges[] | select( .node.title == \"${MILESTONE_TITLE}\" ) | .node.number")
Expand All @@ -105,7 +106,7 @@ jobs:
# create the milestone if needed
- name: Create milestone if needed
id: create_milestone
if: steps.extract_data.outputs.has_milestone_to_set == "true" && steps.extract_data.outputs.has_milestone_to_create == "true"
if: steps.extract_data.outputs.has_milestone_to_set == true && steps.extract_data.outputs.has_milestone_to_create == true
uses: octokit/request-action@v2.x
with:
route: POST /repos/qgis/QGIS/milestones
Expand All @@ -116,7 +117,7 @@ jobs:
# Compute the milestone number
- name: Compute milestone number from existing or created
id: compute_milestone
if: always() && steps.extract_data.outputs.has_milestone_to_set == "true"
if: always() == true && steps.extract_data.outputs.has_milestone_to_set == true
env:
MILESTONE_NUMBER_EXISTING: ${{ steps.calculate_milestone.outputs.milestone_number }}
MILESTONE_NUMBER_CREATED_JSON: ${{ steps.create_milestone.outputs.data }}
Expand All @@ -127,7 +128,7 @@ jobs:
# update PR with milestone
- name: update PR milestone
if: steps.extract_data.outputs.has_milestone_to_set == "true"
if: steps.extract_data.outputs.has_milestone_to_set == true
uses: octokit/request-action@v2.x
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit b4b4338

Please sign in to comment.