6060 echo "Branch $BRANCH does not exist - proceeding with following steps"
6161 fi
6262
63+ - name : Push empty release branch
64+ if : steps.check-branch.outputs.creating_new_branch == 'true'
65+ uses : DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
66+ with :
67+ token : " ${{ steps.octo-sts.outputs.token }}"
68+ branch : " ${{ steps.define-branch.outputs.branch }}"
69+ head-sha : " ${{ github.sha }}"
70+ create-branch : true
71+ command : push
72+ commits : " "
73+
74+ - name : Define temp branch name
75+ if : steps.check-branch.outputs.creating_new_branch == 'true'
76+ id : define-temp-branch
77+ run : |
78+ TEMP_BRANCH="${{ steps.define-branch.outputs.branch }}-pin-system-tests"
79+ echo "branch=${TEMP_BRANCH}" >> "$GITHUB_OUTPUT"
80+
6381 - name : Update system-tests references to latest commit SHA on main
6482 if : steps.check-branch.outputs.creating_new_branch == 'true'
6583 run : BRANCH=main ./tooling/update_system_test_reference.sh
@@ -73,15 +91,25 @@ jobs:
7391 git commit -m "chore: Pin system-tests for release branch" .github/workflows/run-system-tests.yaml
7492 echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
7593
76- - name : Push changes
94+ - name : Push changes to temp branch
7795 if : steps.check-branch.outputs.creating_new_branch == 'true'
7896 uses : DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
7997 with :
8098 token : " ${{ steps.octo-sts.outputs.token }}"
81- branch : " ${{ steps.define-branch.outputs.branch }}"
82- # for scheduled runs, sha is the tip of the default branch
83- # for dispatched runs, sha is the tip of the branch it was dispatched on
99+ branch : " ${{ steps.define-temp-branch.outputs.branch }}"
84100 head-sha : " ${{ github.sha }}"
85101 create-branch : true
86102 command : push
87103 commits : " ${{ steps.create-commit.outputs.commit }}"
104+
105+ - name : Create pull request from temp branch to release branch
106+ if : steps.check-branch.outputs.creating_new_branch == 'true'
107+ env :
108+ GH_TOKEN : ${{ steps.octo-sts.outputs.token }}
109+ run : |
110+ gh pr create --title "Pin system-tests for ${{ steps.define-branch.outputs.branch }}" \
111+ --base "${{ steps.define-branch.outputs.branch }}" \
112+ --head "${{ steps.define-temp-branch.outputs.branch }}" \
113+ --label "tag: dependencies" \
114+ --label "tag: no release notes" \
115+ --body "This PR pins the system-tests reference for the release branch."
0 commit comments