Skip to content

Commit 5dc63f9

Browse files
authored
added action to comment on release pr (#577)
1 parent f646ed1 commit 5dc63f9

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/create-release-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ jobs:
3131
# include date in the pr branch name to ensure duplicate branches to not get created.
3232
PR_BRANCH_NAME: 'release-v${{steps.release_version.outputs.OUTPUT}}-${{ steps.release_version.outputs.DATE }}'
3333
PR_TITLE: 'Release MongoDB Kubernetes Operator v${{ steps.release_version.outputs.OUTPUT }}'
34+
35+
# Note: sonar github is a repo scoped token, which allows this action to trigger other actions.
36+
GITHUB_TOKEN: ${{ secrets.SONAR_GITHUB_TOKEN }}

.github/workflows/release-images.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,25 @@ jobs:
9090
bodyFile: "${{ github.workspace }}/docs/RELEASE_NOTES.md"
9191
draft: true
9292
token: ${{ secrets.GITHUB_TOKEN }}
93+
94+
comment:
95+
runs-on: ubuntu-latest
96+
needs: [merge-release-pr-and-draft-github-release]
97+
steps:
98+
- name: Checkout Code
99+
uses: actions/checkout@v2
100+
- name: Determine Release Version
101+
id: release_version
102+
run: |
103+
VERSION=$(jq -r '."mongodb-kubernetes-operator"' < $GITHUB_WORKSPACE/release.json)
104+
echo "::set-output name=version::${VERSION}"
105+
- uses: actions/github-script@v3
106+
with:
107+
github-token: ${{secrets.GITHUB_TOKEN}}
108+
script: |
109+
github.issues.createComment({
110+
issue_number: context.issue.number,
111+
owner: context.repo.owner,
112+
repo: context.repo.repo,
113+
body: 'Review and publish the release here: https://github.com/mongodb/mongodb-kubernetes-operator/releases/tag/v${{ steps.release_version.outputs.version }}'
114+
})

0 commit comments

Comments
 (0)