1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- name : Build main with Svace every weekend
15+ name : Build latest CSE branch with Svace every weekend
1616env :
1717 MODULES_REGISTRY : ${{ vars.DEV_REGISTRY }}
1818 CI_COMMIT_REF_NAME : ${{ github.ref_name }}
@@ -43,10 +43,22 @@ jobs:
4343 modules_module_tag : ${{ steps.modules_module_tag.outputs.MODULES_MODULE_TAG }}
4444 module_edition : ${{ steps.modules_module_tag.outputs.MODULE_EDITION }}
4545 runner_type : ${{ steps.modules_module_tag.outputs.RUNNER_TYPE }}
46+ checkout_tag : ${{ steps.modules_module_tag.outputs.CHECKOUT_TAG }}
4647 steps :
48+ - uses : actions/checkout@v4
49+ with :
50+ fetch-depth : 0
51+ ref : " ${{ github.event.pull_request.head.sha || github.sha }}"
4752 - name : Set vars
4853 id : modules_module_tag
4954 run : |
55+ if [[ "${{ github.event_name }}" == 'schedule' ]]; then
56+ # get last semver branch with remotes/origin/release-X.Y format
57+ CHECKOUT_TAG=$(git branch --all | grep -E 'remotes\/origin\/release-[0-9]+\.[0-9]+-cse$' | sort -V | tail -n 1)
58+ else
59+ CHECKOUT_TAG=${{ github.event.pull_request.head.sha || github.sha }}
60+ fi
61+ echo "CHECKOUT_TAG=$CHECKOUT_TAG" >> "$GITHUB_OUTPUT"
5062 if [[ "${{ github.ref_name }}" == 'main' ]]; then
5163 MODULES_MODULE_TAG="${{ github.ref_name }}-svace"
5264 elif [[ "${{ github.ref_name }}" =~ ^release-[0-9]+\.[0-9]+ ]]; then
7991 env :
8092 MODULES_MODULE_TAG : ${{needs.set_vars.outputs.modules_module_tag}}
8193 MODULE_EDITION : ${{needs.set_vars.outputs.module_edition}}
94+ CHECKOUT_TAG : ${{needs.set_vars.outputs.checkout_tag}}
8295 WERF_VIRTUAL_MERGE : 0
8396 steps :
8497 - name : Setup Docker config
@@ -94,11 +107,11 @@ jobs:
94107 echo MODULE_EDITION=$MODULE_EDITION
95108 echo MODULES_MODULE_TAG=$MODULES_MODULE_TAG
96109 echo DOCKER_CONFIG=$DOCKER_CONFIG
97-
110+ echo CHECKOUT_TAG=$CHECKOUT_TAG
98111 - uses : actions/checkout@v4
99112 with :
100113 fetch-depth : 0
101- ref : ${{ github.event.pull_request.head.sha || github.sha }}
114+ ref : ${{needs.set_vars.outputs.checkout_tag }}
102115
103116 - name : Remove unwanted software
104117 if : ${{ !contains(needs.set_vars.outputs.runner_type, 'self-hosted') }}
0 commit comments