mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-25 16:37:23 +08:00
Add validation for source branch in backport workflow (#14042)
This commit is contained in:
parent
5d681a5420
commit
8fecef0686
5
.github/workflows/backport_release.yaml
vendored
5
.github/workflows/backport_release.yaml
vendored
@ -42,8 +42,13 @@ jobs:
|
|||||||
- name: Validate source branch exists
|
- name: Validate source branch exists
|
||||||
env:
|
env:
|
||||||
SOURCE_BRANCH: ${{ inputs.branch }}
|
SOURCE_BRANCH: ${{ inputs.branch }}
|
||||||
|
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
if [[ "${SOURCE_BRANCH}" == "${DEFAULT_BRANCH}" ]]; then
|
||||||
|
echo "::error::Source branch must not be the default branch ('${DEFAULT_BRANCH}')."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
git fetch origin "refs/heads/${SOURCE_BRANCH}:refs/remotes/origin/${SOURCE_BRANCH}"
|
git fetch origin "refs/heads/${SOURCE_BRANCH}:refs/remotes/origin/${SOURCE_BRANCH}"
|
||||||
if ! git show-ref --verify --quiet "refs/remotes/origin/${SOURCE_BRANCH}"; then
|
if ! git show-ref --verify --quiet "refs/remotes/origin/${SOURCE_BRANCH}"; then
|
||||||
echo "::error::Source branch '${SOURCE_BRANCH}' not found on origin."
|
echo "::error::Source branch '${SOURCE_BRANCH}' not found on origin."
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user