mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 22:21:10 +02:00
.github: skip touching open PRs when the remote branch exists
To avoid noise of touching existing PRs, check first if the remote branch already exists. If that exists, skip creating or updating the PR.
This commit is contained in:
parent
979d7d0720
commit
b2e55c063a
5
.github/workflows/cacerts-apply-patch.sh
vendored
5
.github/workflows/cacerts-apply-patch.sh
vendored
@ -6,6 +6,11 @@ source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh"
|
|||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
|
if ! check_remote_branch "cacerts-${VERSION_NEW}-${TARGET_BRANCH}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${SDK_OUTER_OVERLAY}"
|
pushd "${SDK_OUTER_OVERLAY}"
|
||||||
|
|
||||||
# Parse the Manifest file for already present source files and keep the latest version in the current series
|
# Parse the Manifest file for already present source files and keep the latest version in the current series
|
||||||
|
1
.github/workflows/cacerts-release.yaml
vendored
1
.github/workflows/cacerts-release.yaml
vendored
@ -53,6 +53,7 @@ jobs:
|
|||||||
VERSION_NEW: ${{ steps.nss-latest-release.outputs.NSS_VERSION }}
|
VERSION_NEW: ${{ steps.nss-latest-release.outputs.NSS_VERSION }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: ${{ steps.figure-out-branch.outputs.BRANCH }}
|
||||||
run: gha/.github/workflows/cacerts-apply-patch.sh
|
run: gha/.github/workflows/cacerts-apply-patch.sh
|
||||||
- name: Create pull request
|
- name: Create pull request
|
||||||
if: (steps.figure-out-branch.outputs.SKIP == 0) && (steps.apply-patch.outputs.UPDATE_NEEDED == 1)
|
if: (steps.figure-out-branch.outputs.SKIP == 0) && (steps.apply-patch.outputs.UPDATE_NEEDED == 1)
|
||||||
|
9
.github/workflows/common.sh
vendored
9
.github/workflows/common.sh
vendored
@ -64,6 +64,15 @@ function prepare_git_repo() {
|
|||||||
git -C "${SDK_OUTER_TOPDIR}" config user.email "${BUILDBOT_USEREMAIL}"
|
git -C "${SDK_OUTER_TOPDIR}" config user.email "${BUILDBOT_USEREMAIL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_remote_branch() {
|
||||||
|
local target_branch="${1}"
|
||||||
|
|
||||||
|
if git -C "${SDK_OUTER_TOPDIR}" show-ref "remotes/origin/${target_branch}"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
# Regenerates a manifest file using an ebuild of a given package with
|
# Regenerates a manifest file using an ebuild of a given package with
|
||||||
# a given version.
|
# a given version.
|
||||||
#
|
#
|
||||||
|
5
.github/workflows/containerd-apply-patch.sh
vendored
5
.github/workflows/containerd-apply-patch.sh
vendored
@ -6,6 +6,11 @@ source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh"
|
|||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
|
if ! check_remote_branch "containerd-${VERSION_NEW}-${TARGET_BRANCH}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${SDK_OUTER_OVERLAY}"
|
pushd "${SDK_OUTER_OVERLAY}"
|
||||||
|
|
||||||
VERSION_OLD=$(sed -n "s/^DIST containerd-\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p" app-emulation/containerd/Manifest | sort -ruV | head -n1)
|
VERSION_OLD=$(sed -n "s/^DIST containerd-\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p" app-emulation/containerd/Manifest | sort -ruV | head -n1)
|
||||||
|
@ -35,6 +35,7 @@ jobs:
|
|||||||
COMMIT_HASH: ${{ steps.containerd-latest-release.outputs.COMMIT_HASH }}
|
COMMIT_HASH: ${{ steps.containerd-latest-release.outputs.COMMIT_HASH }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: main
|
||||||
run: scripts/.github/workflows/containerd-apply-patch.sh
|
run: scripts/.github/workflows/containerd-apply-patch.sh
|
||||||
- name: Create pull request for main
|
- name: Create pull request for main
|
||||||
uses: peter-evans/create-pull-request@v5
|
uses: peter-evans/create-pull-request@v5
|
||||||
|
5
.github/workflows/docker-apply-patch.sh
vendored
5
.github/workflows/docker-apply-patch.sh
vendored
@ -6,6 +6,11 @@ source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh"
|
|||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
|
if ! check_remote_branch "docker-${VERSION_NEW}-${TARGET_BRANCH}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${SDK_OUTER_OVERLAY}"
|
pushd "${SDK_OUTER_OVERLAY}"
|
||||||
|
|
||||||
VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1)
|
VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1)
|
||||||
|
1
.github/workflows/docker-release-main.yaml
vendored
1
.github/workflows/docker-release-main.yaml
vendored
@ -38,6 +38,7 @@ jobs:
|
|||||||
COMMIT_HASH_CLI: ${{ steps.docker-latest-release.outputs.COMMIT_HASH_CLI }}
|
COMMIT_HASH_CLI: ${{ steps.docker-latest-release.outputs.COMMIT_HASH_CLI }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: main
|
||||||
run: scripts/.github/workflows/docker-apply-patch.sh
|
run: scripts/.github/workflows/docker-apply-patch.sh
|
||||||
- name: Create pull request for main
|
- name: Create pull request for main
|
||||||
uses: peter-evans/create-pull-request@v5
|
uses: peter-evans/create-pull-request@v5
|
||||||
|
5
.github/workflows/firmware-apply-patch.sh
vendored
5
.github/workflows/firmware-apply-patch.sh
vendored
@ -6,6 +6,11 @@ source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh"
|
|||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
|
if ! check_remote_branch "firmware-${VERSION_NEW}-${TARGET_BRANCH}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${SDK_OUTER_OVERLAY}"
|
pushd "${SDK_OUTER_OVERLAY}"
|
||||||
|
|
||||||
# Parse the Manifest file for already present source files and keep the latest version in the current series
|
# Parse the Manifest file for already present source files and keep the latest version in the current series
|
||||||
|
1
.github/workflows/firmware-release-main.yaml
vendored
1
.github/workflows/firmware-release-main.yaml
vendored
@ -32,6 +32,7 @@ jobs:
|
|||||||
VERSION_NEW: ${{ steps.firmware-latest-release.outputs.VERSION_NEW }}
|
VERSION_NEW: ${{ steps.firmware-latest-release.outputs.VERSION_NEW }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: main
|
||||||
run: scripts/.github/workflows/firmware-apply-patch.sh
|
run: scripts/.github/workflows/firmware-apply-patch.sh
|
||||||
- name: Create pull request for main
|
- name: Create pull request for main
|
||||||
uses: peter-evans/create-pull-request@v5
|
uses: peter-evans/create-pull-request@v5
|
||||||
|
5
.github/workflows/go-apply-patch.sh
vendored
5
.github/workflows/go-apply-patch.sh
vendored
@ -18,6 +18,11 @@ done
|
|||||||
|
|
||||||
branch_name="go-$(join_by '-and-' ${VERSIONS_NEW})-main"
|
branch_name="go-$(join_by '-and-' ${VERSIONS_NEW})-main"
|
||||||
|
|
||||||
|
if ! check_remote_branch "${branch_name}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Parse the Manifest file for already present source files and keep the latest version in the current series
|
# Parse the Manifest file for already present source files and keep the latest version in the current series
|
||||||
# DIST go1.17.src.tar.gz ... => 1.17
|
# DIST go1.17.src.tar.gz ... => 1.17
|
||||||
# DIST go1.17.1.src.tar.gz ... => 1.17.1
|
# DIST go1.17.1.src.tar.gz ... => 1.17.1
|
||||||
|
1
.github/workflows/go-release-main.yaml
vendored
1
.github/workflows/go-release-main.yaml
vendored
@ -33,6 +33,7 @@ jobs:
|
|||||||
VERSIONS_NEW: ${{ steps.go-latest-release.outputs.VERSIONS_NEW }}
|
VERSIONS_NEW: ${{ steps.go-latest-release.outputs.VERSIONS_NEW }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: main
|
||||||
run: scripts/.github/workflows/go-apply-patch.sh
|
run: scripts/.github/workflows/go-apply-patch.sh
|
||||||
- name: Create pull request for main
|
- name: Create pull request for main
|
||||||
uses: peter-evans/create-pull-request@v5
|
uses: peter-evans/create-pull-request@v5
|
||||||
|
5
.github/workflows/kernel-apply-patch.sh
vendored
5
.github/workflows/kernel-apply-patch.sh
vendored
@ -6,6 +6,11 @@ source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh"
|
|||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
|
if ! check_remote_branch "linux-${VERSION_NEW}-${TARGET_BRANCH}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${SDK_OUTER_OVERLAY}"
|
pushd "${SDK_OUTER_OVERLAY}"
|
||||||
|
|
||||||
# trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4
|
# trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4
|
||||||
|
1
.github/workflows/kernel-release.yaml
vendored
1
.github/workflows/kernel-release.yaml
vendored
@ -54,6 +54,7 @@ jobs:
|
|||||||
VERSION_NEW: ${{ steps.kernel-latest-release.outputs.KERNEL_VERSION }}
|
VERSION_NEW: ${{ steps.kernel-latest-release.outputs.KERNEL_VERSION }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: ${{ steps.figure-out-branch.outputs.BRANCH }}
|
||||||
run: gha/.github/workflows/kernel-apply-patch.sh
|
run: gha/.github/workflows/kernel-apply-patch.sh
|
||||||
- name: Create pull request
|
- name: Create pull request
|
||||||
if: (steps.figure-out-branch.outputs.SKIP == 0) && (steps.apply-patch.outputs.UPDATE_NEEDED == 1)
|
if: (steps.figure-out-branch.outputs.SKIP == 0) && (steps.apply-patch.outputs.UPDATE_NEEDED == 1)
|
||||||
|
5
.github/workflows/runc-apply-patch.sh
vendored
5
.github/workflows/runc-apply-patch.sh
vendored
@ -6,6 +6,11 @@ source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh"
|
|||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
|
if ! check_remote_branch "runc-${VERSION_NEW}-${TARGET_BRANCH}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${SDK_OUTER_OVERLAY}"
|
pushd "${SDK_OUTER_OVERLAY}"
|
||||||
|
|
||||||
# Get the newest runc version, including official releases and rc
|
# Get the newest runc version, including official releases and rc
|
||||||
|
1
.github/workflows/runc-release-main.yaml
vendored
1
.github/workflows/runc-release-main.yaml
vendored
@ -50,6 +50,7 @@ jobs:
|
|||||||
COMMIT_HASH: ${{ steps.runc-latest-release.outputs.COMMIT_HASH }}
|
COMMIT_HASH: ${{ steps.runc-latest-release.outputs.COMMIT_HASH }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: main
|
||||||
run: scripts/.github/workflows/runc-apply-patch.sh
|
run: scripts/.github/workflows/runc-apply-patch.sh
|
||||||
- name: Create pull request for main
|
- name: Create pull request for main
|
||||||
uses: peter-evans/create-pull-request@v5
|
uses: peter-evans/create-pull-request@v5
|
||||||
|
5
.github/workflows/rust-apply-patch.sh
vendored
5
.github/workflows/rust-apply-patch.sh
vendored
@ -6,6 +6,11 @@ source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh"
|
|||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
|
if ! check_remote_branch "rust-${VERSION_NEW}-${TARGET_BRANCH}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${SDK_OUTER_OVERLAY}"
|
pushd "${SDK_OUTER_OVERLAY}"
|
||||||
|
|
||||||
VERSION_OLD=$(sed -n "s/^DIST rustc-\(1\.[0-9]*\.[0-9]*\).*/\1/p" dev-lang/rust/Manifest | sort -ruV | head -n1)
|
VERSION_OLD=$(sed -n "s/^DIST rustc-\(1\.[0-9]*\.[0-9]*\).*/\1/p" dev-lang/rust/Manifest | sort -ruV | head -n1)
|
||||||
|
1
.github/workflows/rust-release-main.yaml
vendored
1
.github/workflows/rust-release-main.yaml
vendored
@ -32,6 +32,7 @@ jobs:
|
|||||||
VERSION_NEW: ${{ steps.rust-latest-release.outputs.VERSION_NEW }}
|
VERSION_NEW: ${{ steps.rust-latest-release.outputs.VERSION_NEW }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: main
|
||||||
run: scripts/.github/workflows/rust-apply-patch.sh
|
run: scripts/.github/workflows/rust-apply-patch.sh
|
||||||
- name: Create pull request for main
|
- name: Create pull request for main
|
||||||
id: create-pull-request
|
id: create-pull-request
|
||||||
|
5
.github/workflows/vmware-apply-patch.sh
vendored
5
.github/workflows/vmware-apply-patch.sh
vendored
@ -6,6 +6,11 @@ source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh"
|
|||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
|
if ! check_remote_branch "open-vm-tools-${VERSION_NEW}-${TARGET_BRANCH}"; then
|
||||||
|
echo "remote branch already exists, nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Update app-emulation/open-vm-tools
|
# Update app-emulation/open-vm-tools
|
||||||
|
|
||||||
pushd "${SDK_OUTER_OVERLAY}"
|
pushd "${SDK_OUTER_OVERLAY}"
|
||||||
|
1
.github/workflows/vmware-release-main.yaml
vendored
1
.github/workflows/vmware-release-main.yaml
vendored
@ -35,6 +35,7 @@ jobs:
|
|||||||
VERSION_NEW: ${{ steps.openvmtools-latest-release.outputs.VERSION_NEW }}
|
VERSION_NEW: ${{ steps.openvmtools-latest-release.outputs.VERSION_NEW }}
|
||||||
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
|
||||||
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
|
||||||
|
TARGET_BRANCH: main
|
||||||
run: scripts/.github/workflows/vmware-apply-patch.sh
|
run: scripts/.github/workflows/vmware-apply-patch.sh
|
||||||
- name: Create pull request for main
|
- name: Create pull request for main
|
||||||
uses: peter-evans/create-pull-request@v5
|
uses: peter-evans/create-pull-request@v5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user