Add GHAs for closing milestone on release

This commit is contained in:
Artem Bilan
2023-11-09 13:38:11 -05:00
parent f65618d8ce
commit a69f75f2b3
3 changed files with 53 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
name: Close Milestone and Notify Slack
on:
release:
types: [ published ]
jobs:
close-milestone:
uses: spring-projects/spring-integration-aws/.github/workflows/close-milestone-on-release.yml@main
with:
releaseTag: ${{ github.ref_name }}
secrets: inherit

View File

@@ -0,0 +1,40 @@
name: Close Milestone and Notify Slack
on:
workflow_call:
inputs:
releaseTag:
description: 'The tag of the release for Milestone to close. Usually starts with `v`'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- id: get-milestone-from-tag
run: echo milestoneName=${${{ inputs.releaseTag }}#v} >> $GITHUB_OUTPUT
- uses: octokit/request-action@v2.x
id: list_milestones
with:
route: GET /repos/${{ github.repository }}/milestones
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
- id: get-milestone-id
run: echo milestoneId=${{steps.list_milestones.outputs.data}} | jq '.[] | select(.title == "${{steps.get-milestone-from-tag.outputs.milestoneName}}") | .number' >> $GITHUB_OUTPUT
- name: Close Milestone
if: ${{steps.get-milestone-id.outputs.milestoneId}}
uses: octokit/request-action@v2.x
with:
route: PATCH /repos/${{ github.repository }}/milestones/${{steps.get-milestone-id.outputs.milestoneId}}
state: "closed"
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}

View File

@@ -56,8 +56,7 @@ jobs:
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV
- name: Set Release Version
run: |
sed -i "s/version=.*/version=${{ inputs.releaseVersion }}/" gradle.properties
run: sed -i "s/version=.*/version=${{ inputs.releaseVersion }}/" gradle.properties
- name: Build and Publish
run: |