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 id: generate-token
uses: actions/create-github-app-token@v1 uses: actions/create-github-app-token@v1
with: with:
app-id: ${{ vars.APP_ID }} app-id: ${{ vars.PUSH_TO_MAIN_APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }} private-key: ${{ secrets.PUSH_TO_MAIN_APP_SECRET }}
repositories: ProxmoxVE
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -73,22 +74,17 @@ jobs:
- name: Create PR if files found - name: Create PR if files found
if: env.files_found == 'true' if: env.files_found == 'true'
env: env:
GH_TOKEN: ${{ secrets.MAIN_REPO_WF }} GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: | run: |
script_name="wf-test" script_name="wf-test"
target_repo="community-scripts/ProxmoxVE" target_repo="community-scripts/ProxmoxVE"
branch_name="add-script-$script_name" branch_name="add-script-$script_name"
echo "branch=$branch_name" >> $GITHUB_ENV
commit_message="Add script files for $script_name" commit_message="Add script files for $script_name"
git remote add upstream https://github.com/${target_repo}.git
git checkout -b "$branch_name" git checkout -b "$branch_name"
cp "ct/$script_name.sh" . cp "ct/$script_name.sh" .
cp "install/$script_name-install.sh" . cp "install/$script_name-install.sh" .
cp "json/$script_name.json" . cp "json/$script_name.json" .
@ -97,19 +93,6 @@ jobs:
git commit -m "$commit_message" git commit -m "$commit_message"
git status git push upstream "$branch_name"
git push origin "$branch_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
- 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 }}

View File

@ -68,18 +68,15 @@ fi
TIMEOUT=60 TIMEOUT=60
while [[ $TIMEOUT -gt 0 ]]; do while [[ $TIMEOUT -gt 0 ]]; do
STATUS=$(docker inspect --format '{{.State.Health.Status}}' "$CONTAINER_ID" 2>/dev/null) STATUS=$(docker inspect --format '{{.State.Health.Status}}' "$CONTAINER_ID" 2>/dev/null)
if [[ "$STATUS" == "healthy" ]]; then
msg_ok "Started NPM Plus"
fi
sleep 2 sleep 2
((TIMEOUT--)) ((TIMEOUT--))
done done
if [[ "$STATUS" != "healthy" ]]; then if [[ "$STATUS" != "healthy" ]]; then
msg_error "NPMplus container did not reach a healthy state." msg_error "NPMplus container did not reach a healthy state."
exit 1
fi fi
msg_ok "Started NPM Plus"
msg_info "Get Default Login (Patience)" msg_info "Get Default Login (Patience)"
TIMEOUT=60 TIMEOUT=60
@ -89,7 +86,6 @@ while [[ $TIMEOUT -gt 0 ]]; do
if [[ -n "$PASSWORD_LINE" ]]; then if [[ -n "$PASSWORD_LINE" ]]; then
PASSWORD=$(echo "$PASSWORD_LINE" | gawk -F 'password: ' '{print $2}') PASSWORD=$(echo "$PASSWORD_LINE" | gawk -F 'password: ' '{print $2}')
echo -e "username: admin@example.org\npassword: $PASSWORD" >/opt/.npm_pwd echo -e "username: admin@example.org\npassword: $PASSWORD" >/opt/.npm_pwd
msg_ok "Saved default login to /opt/.npm_pwd"
fi fi
sleep 2 sleep 2
@ -99,7 +95,7 @@ done
if [[ $TIMEOUT -eq 0 ]]; then if [[ $TIMEOUT -eq 0 ]]; then
msg_error "Failed to retrieve default login credentials." msg_error "Failed to retrieve default login credentials."
fi fi
msg_ok "Get Default Login Successful" msg_ok "Saved default login to /opt/.npm_pwd"
motd_ssh motd_ssh
customize customize