mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-28 20:52:06 +01:00
.yaml: use HEAD commit ref for PR builds
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This commit is contained in:
parent
f1e3b30537
commit
bed3bf87d4
15
.github/workflows/ci.yaml
vendored
15
.github/workflows/ci.yaml
vendored
@ -76,6 +76,21 @@ jobs:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
# Hack alert: actions/checkout will check out the (disjunct) merge commit of a PR
|
||||
# instead of its head commit. That commit is not connected to any branch.
|
||||
# This causes breakage downstream e.g. when the devcontainer test wants to check out
|
||||
# the ref in the scripts repo that corresponds to this build.
|
||||
- name: If this is a PR build, use head commit instead of the merge commit
|
||||
if: ${{ github.event.pull_request.head.sha }}
|
||||
shell: bash
|
||||
run: |
|
||||
exec 2>&1
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
git checkout ${{ github.event.pull_request.head.sha }}
|
||||
git submodule update
|
||||
|
||||
- name: Set environment
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
16
.github/workflows/run-kola-tests.yaml
vendored
16
.github/workflows/run-kola-tests.yaml
vendored
@ -60,6 +60,22 @@ jobs:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
# Hack alert: actions/checkout will check out the (disjunct) merge commit of a PR
|
||||
# instead of its head commit. That commit is not connected to any branch.
|
||||
# This is not technically necessary for the tests run but it is done to remain aligned
|
||||
# with the ref.
|
||||
- name: If this is a PR build, use head commit instead of the merge commit
|
||||
if: ${{ github.event.pull_request.head.sha }}
|
||||
shell: bash
|
||||
run: |
|
||||
exec 2>&1
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
cd scripts
|
||||
git checkout ${{ github.event.pull_request.head.sha }}
|
||||
git submodule update
|
||||
|
||||
- name: Download binpkgs
|
||||
if: ${{ !inputs.workflow_run_id }}
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user