From 092fa3b135a96979cba00de4a4f43cb1e88174ec Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 3 Feb 2025 10:26:14 +0900 Subject: [PATCH] WORKFLOW: revamped push_flathub_main - fix3 [skip ci] --- .github/workflows/flathub_push_main.yml | 2 +- automation_tools/flathub_push_main.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/flathub_push_main.yml b/.github/workflows/flathub_push_main.yml index 5ebf18ac..b4431b15 100644 --- a/.github/workflows/flathub_push_main.yml +++ b/.github/workflows/flathub_push_main.yml @@ -21,4 +21,4 @@ jobs: env: GIT_NAME: ${{ secrets.GITNAME }} GIT_MAIL: ${{ secrets.GITMAIL }} - GIT_TOKEN: ${{ secrets.GITTOKEN }} + GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/automation_tools/flathub_push_main.sh b/automation_tools/flathub_push_main.sh index 4a438226..b447aff0 100755 --- a/automation_tools/flathub_push_main.sh +++ b/automation_tools/flathub_push_main.sh @@ -17,9 +17,7 @@ if [ -d flathub ]; then rm -rf flathub fi git clone --depth=1 --recursive "https://github.com/$flathub_target_repo.git" flathub -cd "$gits_folder" || exit 1 git clone --depth=1 --recursive "https://github.com/$retrodeck_repo.git" RetroDECK -cd "$gits_folder/RetroDECK" || exit 1 relname=$(curl -s https://api.github.com/repos/$retrodeck_repo/releases | jq -r '[.[] | select(.prerelease == true)][0].tag_name // empty') if [ -z "$relname" ]; then @@ -36,12 +34,14 @@ git rm -rf * git clean -fxd # restroing git index # Copying only a few files as the others are cloned by git in retrodeck.sh -cd "$gits_folder/RetroDECK" || exit 1 -cp -rf \ -'LICENSE' \ -'README.md' \ -'other_licenses.txt' \ -"$gits_folder/flathub/" +files_to_copy=('LICENSE' 'README.md' 'other_licenses.txt') +for file in "${files_to_copy[@]}"; do + if [ -f "$file" ]; then + cp -fv "$file" "$gits_folder/flathub" + else + echo "Warning: $file not found in $gits_folder/RetroDECK" + fi +done cd "$gits_folder/flathub" || exit 1 ls -lah