From ee6d655415a8454e7cc2d088c8e45f8afb7d2d9c Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 3 Feb 2025 13:46:04 +0900 Subject: [PATCH] WORKFLOW: trying using gh instead - fix2 [skip ci] --- automation_tools/flathub_push_main.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/automation_tools/flathub_push_main.sh b/automation_tools/flathub_push_main.sh index 3f243c04..7d914a33 100755 --- a/automation_tools/flathub_push_main.sh +++ b/automation_tools/flathub_push_main.sh @@ -98,9 +98,15 @@ git add . git commit -m "Update RetroDECK to v$relname from RetroDECK/$rd_branch" if [ -n "${GITHUB_WORKFLOW}" ]; then + + if ! git ls-remote --exit-code --heads origin "$relname"; then + echo "Branch $relname not found. Creating..." + git checkout -b "$relname" + git push -u origin "$relname" + fi + gh auth login --with-token <<< "${GITHUB_TOKEN}" gh repo set-default "${flathub_target_repo}" - gh repo create-branch --branch "$relname" gh repo sync --force --branch "$relname" else git push --force "https://github.com/${flathub_target_repo}" "$relname"