File tree Expand file tree Collapse file tree 2 files changed +35
-20
lines changed Expand file tree Collapse file tree 2 files changed +35
-20
lines changed Original file line number Diff line number Diff line change @@ -205,22 +205,3 @@ jobs:
205205 color : danger
206206 env :
207207 SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
208-
209- trigger-repo-sync :
210- runs-on : ubuntu-20.04
211- name : ' Sync runtime repo'
212- timeout-minutes : 60
213- steps :
214- - name : Checkout
215- uses : actions/checkout@v4
216- - name : Trigger runtime
217- uses : actions/github-script@v6
218- with :
219- github-token : ${{ secrets.GH_TRIGGER_TOKEN }}
220- script : |
221- await github.rest.actions.createWorkflowDispatch({
222- owner: 'cubedevinc',
223- repo: 'cube-runtime',
224- workflow_id: 'sync.yml',
225- ref: 'master'
226- })
Original file line number Diff line number Diff line change @@ -744,7 +744,7 @@ jobs:
744744 name : Trigger test suites run
745745 runs-on : ubuntu-20.04
746746 needs : [docker-default]
747- timeout-minutes : 60
747+ timeout-minutes : 15
748748 steps :
749749 - name : Checkout
750750 uses : actions/checkout@v4
@@ -769,3 +769,37 @@ jobs:
769769 'initiator': '${{ github.actor }}'
770770 }
771771 })
772+
773+ trigger-repo-sync :
774+ name : Trigger runtime repo
775+ runs-on : ubuntu-20.04
776+ needs : [docker-default]
777+ timeout-minutes : 15
778+ steps :
779+ - name : Checkout
780+ uses : actions/checkout@v4
781+ with :
782+ fetch-depth : 0 # Ensure full git history is fetched
783+ - name : Detect branch name
784+ id : detect_branch
785+ run : |
786+ BRANCH_NAME=$(git branch -r --contains $GITHUB_SHA | grep -v 'HEAD' | head -n 1 | sed -e 's/.*origin\///')
787+ echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
788+ - name : Trigger runtime
789+ uses : actions/github-script@v6
790+ with :
791+ github-token : ${{ secrets.GH_TRIGGER_TOKEN }}
792+ script : |
793+ const tagName = process.env.GITHUB_REF.replace('refs/tags/', '');
794+ const branchName = '${{ steps.detect_branch.outputs.branch_name }}';
795+
796+ await github.rest.actions.createWorkflowDispatch({
797+ owner: 'cubedevinc',
798+ repo: 'cube-runtime',
799+ workflow_id: 'sync.yml',
800+ ref: 'master',
801+ inputs: {
802+ 'tag': tagName,
803+ 'branch': branchName,
804+ }
805+ })
You can’t perform that action at this time.
0 commit comments