forked from SteamWar/SteamWar
Merge pull request 'Test Backporting' (#345) from test/backporting into main
Reviewed-on: SteamWar/SteamWar#345
This commit is contained in:
@@ -127,7 +127,7 @@ jobs:
|
|||||||
failures=()
|
failures=()
|
||||||
for target_branch in "${version_branches[@]}"; do
|
for target_branch in "${version_branches[@]}"; do
|
||||||
safe_target="$(sed -E 's#[^A-Za-z0-9._-]+#-#g; s#^-+##; s#-+$##' <<< "$target_branch")"
|
safe_target="$(sed -E 's#[^A-Za-z0-9._-]+#-#g; s#^-+##; s#-+$##' <<< "$target_branch")"
|
||||||
head_branch="backport/pr-${pr_number}-to-${safe_target}"
|
head_branch="backport-pr-${pr_number}-to-${safe_target}"
|
||||||
|
|
||||||
existing_pr="$(api GET "${repo_path}/pulls?state=open&base_branch=$(jq -rn --arg value "$target_branch" '$value|@uri')&limit=50" |
|
existing_pr="$(api GET "${repo_path}/pulls?state=open&base_branch=$(jq -rn --arg value "$target_branch" '$value|@uri')&limit=50" |
|
||||||
jq -r --arg head "$head_branch" '.[] | select(.head.ref == $head) | .number' |
|
jq -r --arg head "$head_branch" '.[] | select(.head.ref == $head) | .number' |
|
||||||
@@ -188,7 +188,6 @@ jobs:
|
|||||||
-o "topic=${head_branch}" \
|
-o "topic=${head_branch}" \
|
||||||
-o "title=Backport #${pr_number} to ${target_branch}: ${pr_title}" \
|
-o "title=Backport #${pr_number} to ${target_branch}: ${pr_title}" \
|
||||||
-o "description=${description}" \
|
-o "description=${description}" \
|
||||||
-o "force-push" \
|
|
||||||
origin "HEAD:refs/for/${target_branch}"
|
origin "HEAD:refs/for/${target_branch}"
|
||||||
echo "Created backport PR from ${head_branch} to ${target_branch}."
|
echo "Created backport PR from ${head_branch} to ${target_branch}."
|
||||||
git checkout main
|
git checkout main
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
name: Merge backport
|
name: Merge backport
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: ${{ startsWith(github.event.pull_request.base.ref, 'version/') && startsWith(github.event.pull_request.head.ref, 'backport/pr-') }}
|
if: ${{ startsWith(github.event.pull_request.base.ref, 'version/') && startsWith(github.event.pull_request.head.ref, 'backport-pr-') }}
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
issues: write
|
issues: write
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2025 SteamWar.de-Serverteam
|
* Copyright (C) 2026 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|||||||
Reference in New Issue
Block a user