Skip to content

Commit 5c23cfd

Browse files
Update update-platform-branch.yaml
1 parent 3ceffa8 commit 5c23cfd

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

.github/workflows/update-platform-branch.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
steps:
2727
- name: Checkout java-sdk repository
2828
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: true # Required for "commit changes" and push steps below
2931

3032
- name: Validate tag as a valid git ref
3133
run: |
@@ -48,13 +50,32 @@ jobs:
4850
TAG="${{ github.event.inputs.tag }}"
4951
find . -name "pom.xml" -exec sed -i.bak "s|<platform.branch>.*</platform.branch>|<platform.branch>${TAG}</platform.branch>|g" {} \;
5052
53+
- name: Fetch release notes for the tag
54+
id: fetch-release-notes
55+
run: |
56+
TAG="${{ github.event.inputs.tag }}"
57+
RELEASE_URL="https://api.github.com/repos/opentdf/platform/releases/tags/$TAG"
58+
RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" "$RELEASE_URL")
59+
RELEASE_NOTES=$(echo "$RESPONSE" | jq -r '.body // ""')
60+
if [ "$RELEASE_NOTES" = "" ]; then
61+
echo "No release notes found for tag $TAG."
62+
fi
63+
echo "::set-output name=release_notes::$RELEASE_NOTES"
64+
echo "::set-output name=release_url::https://github.com/opentdf/platform/releases/tag/$TAG"
65+
5166
- name: Commit changes
5267
run: |
5368
git config user.name "github-actions[bot]"
5469
git config user.email "github-actions[bot]@users.noreply.github.com"
5570
git checkout -b update-platform-branch
5671
git add .
57-
git commit -m "fix(sdk): Updates to proto version ${{ github.event.inputs.tag }}"
72+
RELEASE_NOTES="${{ steps.fetch-release-notes.outputs.release_notes }}"
73+
RELEASE_URL="${{ steps.fetch-release-notes.outputs.release_url }}"
74+
if [ -n "$RELEASE_NOTES" ]; then
75+
git commit -m "fix(sdk): Updates to proto version ${{ github.event.inputs.tag }}\n\nRelease Notes:\n$RELEASE_NOTES\n\nSee the release: $RELEASE_URL"
76+
else
77+
git commit -m "fix(sdk): Updates to proto version ${{ github.event.inputs.tag }}\n\nSee the release: $RELEASE_URL"
78+
fi
5879
5980
- name: Push changes
6081
run: |
@@ -67,5 +88,11 @@ jobs:
6788
commit-message: "fix(sdk): Updates to proto version ${{ github.event.inputs.tag }}"
6889
branch: update-platform-branch
6990
title: "fix(sdk): Updates to proto version ${{ github.event.inputs.tag }}"
70-
body: "This PR updates the platform.branch property in all pom.xml files to the new tag or branch: ${{ github.event.inputs.tag }}."
91+
body: |
92+
This PR updates the platform.branch property in all pom.xml files to the new tag or branch: ${{ github.event.inputs.tag }}.
93+
94+
See the release: ${{ steps.fetch-release-notes.outputs.release_url }}
95+
96+
Release Notes:
97+
${{ steps.fetch-release-notes.outputs.release_notes }}
7198
labels: "automated-update"

0 commit comments

Comments
 (0)