@@ -623,3 +623,38 @@ jobs:
623
623
run : exit 1
624
624
- name : succeed if everything else passed
625
625
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