Skip to content

Commit 2e9f269

Browse files
Automate EC Release Notes (#2162)
* add job to generate ec release notes * only generate release notes if the tag commit is from main
1 parent 33ef905 commit 2e9f269

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/release-prod.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,3 +623,38 @@ jobs:
623623
run: exit 1
624624
- name: succeed if everything else passed
625625
run: echo "Validation succeeded"
626+
627+
generate-ec-release-notes-pr:
628+
runs-on: ubuntu-latest
629+
needs: [release, release-app, get-tag]
630+
steps:
631+
- name: Checkout
632+
uses: actions/checkout@v4
633+
with:
634+
fetch-depth: 0
635+
636+
- name: Check if tag is from main branch
637+
id: check-main
638+
run: |
639+
# Get the commit that the tag points to
640+
TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref }})
641+
642+
# Check if this commit is an ancestor of the main branch (or the same commit)
643+
if git merge-base --is-ancestor $TAG_COMMIT origin/main; then
644+
echo "Tag was created from main branch"
645+
echo "is_from_main=true" >> $GITHUB_OUTPUT
646+
else
647+
echo "Tag was NOT created from main branch"
648+
echo "is_from_main=false" >> $GITHUB_OUTPUT
649+
fi
650+
651+
- name: Generate EC Release Notes PR
652+
if: steps.check-main.outputs.is_from_main == 'true'
653+
env:
654+
GIT_TAG: ${{ needs.get-tag.outputs.tag-name }}
655+
GH_PAT: ${{ secrets.GH_PAT }}
656+
run: |
657+
curl -H "Authorization: token $GH_PAT" \
658+
-H 'Accept: application/json' \
659+
-d "{\"event_type\": \"embedded-cluster-release-notes\", \"client_payload\": {\"version\": \"${GIT_TAG}\"}}" \
660+
"https://api.github.com/repos/replicatedhq/replicated-docs/dispatches"

0 commit comments

Comments
 (0)