Add GHAs for closing milestone on release
This commit is contained in:
12
.github/workflows/ci-close-milestone.yml
vendored
Normal file
12
.github/workflows/ci-close-milestone.yml
vendored
Normal 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
|
||||
40
.github/workflows/close-milestone-on-release.yml
vendored
Normal file
40
.github/workflows/close-milestone-on-release.yml
vendored
Normal 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 }}
|
||||
|
||||
|
||||
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user