From 3603891163be6749001851517171e43bc693ec9b Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 11 Mar 2025 10:23:27 +0100 Subject: [PATCH] WF --- .github/workflows/move-to-main-repo.yaml | 32 ++++++------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/workflows/move-to-main-repo.yaml b/.github/workflows/move-to-main-repo.yaml index f5c0553..834fa9b 100644 --- a/.github/workflows/move-to-main-repo.yaml +++ b/.github/workflows/move-to-main-repo.yaml @@ -76,40 +76,24 @@ jobs: GH_TOKEN: ${{ secrets.MAIN_REPO_WF }} run: | script_name="wf-test" - target_repo="community-scripts/ProxmoxVE" - branch_name="add-script-$script_name" - echo "branch=$branch_name" >> $GITHUB_ENV - commit_message="Add script files for $script_name" + git remote add upstream https://github.com/${target_repo}.git - git checkout -b "$branch_name" + git pull upstream main + git switch -c "upstream/$branch_name" - - cp "ct/$script_name.sh" . - cp "install/$script_name-install.sh" . - cp "json/$script_name.json" . + git checkout origin/main "ct/$script_name.sh" . + git checkout origin/main "install/$script_name-install.sh" . + git checkout origin/main "json/$script_name.json" . git add . git commit -m "$commit_message" - git status + git push upstream "$branch_name" - git push origin "$branch_name" - - - name: Open PR - id: open_pr - uses: rematocorp/open-pull-request-action@v1 - with: - github-token: ${{ secrets.MAIN_REPO_WF }} - from-branch: ${{ env.branch }} - to-branch: main - repository-owner: communtiy-scripts - repository: ProxmoxVE - - - name: Echo mergeable PR number - run: echo ${{ steps.open_pr.outputs.pull_number }} + gh pr create --base main --head "$branch_name" --title "$commit_message" --body "This PR adds the script files for $script_name."