This commit is contained in:
CanbiZ 2025-03-11 10:50:38 +01:00
commit a543473d76
2 changed files with 10 additions and 31 deletions

View File

@ -16,8 +16,9 @@ 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 }}
repositories: ProxmoxVE
- name: Checkout repository
uses: actions/checkout@v4
@ -73,22 +74,17 @@ 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"
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"
cp "ct/$script_name.sh" .
cp "install/$script_name-install.sh" .
cp "json/$script_name.json" .
@ -97,19 +93,6 @@ jobs:
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." -R $target_repo

View File

@ -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