From 3603891163be6749001851517171e43bc693ec9b Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 11 Mar 2025 10:23:27 +0100 Subject: [PATCH 1/6] 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 f5c05534..834fa9b8 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." From 81f7304db5e5f286675a8f81cda123ec2d3a921c Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 11 Mar 2025 10:24:57 +0100 Subject: [PATCH 2/6] WF --- .github/workflows/move-to-main-repo.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/move-to-main-repo.yaml b/.github/workflows/move-to-main-repo.yaml index 834fa9b8..434d62d0 100644 --- a/.github/workflows/move-to-main-repo.yaml +++ b/.github/workflows/move-to-main-repo.yaml @@ -82,8 +82,6 @@ jobs: git remote add upstream https://github.com/${target_repo}.git - git pull upstream main - git switch -c "upstream/$branch_name" git checkout origin/main "ct/$script_name.sh" . From 0d7d3b5a0716ee5a8c5df87b1b315d2a19d3eb22 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 11 Mar 2025 10:29:46 +0100 Subject: [PATCH 3/6] WF --- .github/workflows/move-to-main-repo.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/move-to-main-repo.yaml b/.github/workflows/move-to-main-repo.yaml index 434d62d0..17d17acd 100644 --- a/.github/workflows/move-to-main-repo.yaml +++ b/.github/workflows/move-to-main-repo.yaml @@ -82,11 +82,11 @@ jobs: git remote add upstream https://github.com/${target_repo}.git - git switch -c "upstream/$branch_name" + git checkout -b "$branch_name" - 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" . + cp "ct/$script_name.sh" . + cp "install/$script_name-install.sh" . + cp "json/$script_name.json" . git add . @@ -94,4 +94,4 @@ jobs: git push upstream "$branch_name" - gh pr create --base main --head "$branch_name" --title "$commit_message" --body "This PR adds the script files for $script_name." + gh pr create --base main --head "$branch_name" --title "$commit_message" --body "This PR adds the script files for $script_name." -R $target_repo From 8e43a0f78368d513ece70ae14a5f57a032120165 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 11 Mar 2025 10:36:45 +0100 Subject: [PATCH 4/6] WF --- .github/workflows/move-to-main-repo.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/move-to-main-repo.yaml b/.github/workflows/move-to-main-repo.yaml index 17d17acd..a2c24f04 100644 --- a/.github/workflows/move-to-main-repo.yaml +++ b/.github/workflows/move-to-main-repo.yaml @@ -16,8 +16,8 @@ jobs: id: generate-token uses: actions/create-github-app-token@v1 with: - app-id: ${{ vars.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} + app-id: ${{ vars.PUSH_TO_MAIN_APP_ID }} + private-key: ${{ secrets.PUSH_TO_MAIN_APP_SECRET }} - name: Checkout repository uses: actions/checkout@v4 @@ -73,7 +73,7 @@ jobs: - name: Create PR if files found if: env.files_found == 'true' env: - GH_TOKEN: ${{ secrets.MAIN_REPO_WF }} + GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | script_name="wf-test" target_repo="community-scripts/ProxmoxVE" From 0a6509f1cf917027a46d12df1281325f64ce9662 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 11 Mar 2025 10:44:20 +0100 Subject: [PATCH 5/6] Update npmplus-install.sh --- install/npmplus-install.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/install/npmplus-install.sh b/install/npmplus-install.sh index b9cf7147..b9ccb3b6 100644 --- a/install/npmplus-install.sh +++ b/install/npmplus-install.sh @@ -68,18 +68,15 @@ fi TIMEOUT=60 while [[ $TIMEOUT -gt 0 ]]; do STATUS=$(docker inspect --format '{{.State.Health.Status}}' "$CONTAINER_ID" 2>/dev/null) - - if [[ "$STATUS" == "healthy" ]]; then - msg_ok "Started NPM Plus" - fi - sleep 2 ((TIMEOUT--)) done if [[ "$STATUS" != "healthy" ]]; then msg_error "NPMplus container did not reach a healthy state." + exit 1 fi +msg_ok "Started NPM Plus" msg_info "Get Default Login (Patience)" TIMEOUT=60 @@ -89,7 +86,6 @@ while [[ $TIMEOUT -gt 0 ]]; do if [[ -n "$PASSWORD_LINE" ]]; then PASSWORD=$(echo "$PASSWORD_LINE" | gawk -F 'password: ' '{print $2}') echo -e "username: admin@example.org\npassword: $PASSWORD" >/opt/.npm_pwd - msg_ok "Saved default login to /opt/.npm_pwd" fi sleep 2 @@ -99,7 +95,7 @@ done if [[ $TIMEOUT -eq 0 ]]; then msg_error "Failed to retrieve default login credentials." fi -msg_ok "Get Default Login Successful" +msg_ok "Saved default login to /opt/.npm_pwd" motd_ssh customize From 0e11890ddfffda981b22f09dc7754ab8b48986dd Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 11 Mar 2025 10:44:50 +0100 Subject: [PATCH 6/6] WF --- .github/workflows/move-to-main-repo.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/move-to-main-repo.yaml b/.github/workflows/move-to-main-repo.yaml index a2c24f04..162da6c1 100644 --- a/.github/workflows/move-to-main-repo.yaml +++ b/.github/workflows/move-to-main-repo.yaml @@ -18,6 +18,7 @@ jobs: with: app-id: ${{ vars.PUSH_TO_MAIN_APP_ID }} private-key: ${{ secrets.PUSH_TO_MAIN_APP_SECRET }} + repositories: ProxmoxVE - name: Checkout repository uses: actions/checkout@v4