Update update_json_date.yml

This commit is contained in:
CanbiZ 2025-02-11 10:07:13 +01:00 committed by GitHub
parent 12ec0b46bc
commit e793dfff3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,8 +40,8 @@ jobs:
- name: Get Open PRs
run: |
echo "Fetching open PRs..."
PRS=$(gh pr list --state open --json number,headRepositoryOwner,headRefName \
--jq '[.[] | {number: .number, repo: .headRepositoryOwner.login, branch: .headRefName}]' || echo "")
PRS=$(gh pr list --state open --json number,headRepositoryOwner,headRepositoryUrl,headRefName \
--jq '[.[] | {number: .number, repo: .headRepositoryUrl, branch: .headRefName}]' || echo "")
if [[ -z "$PRS" || "$PRS" == "[]" ]]; then
echo "No open PRs found."
@ -63,29 +63,24 @@ jobs:
fi
PR_NUMBER=$(echo "$PR_ENTRY" | jq -r '.number // empty')
PR_REPO=$(echo "$PR_ENTRY" | jq -r '.repo // empty')
PR_REPO_URL=$(echo "$PR_ENTRY" | jq -r '.repo // empty')
PR_BRANCH=$(echo "$PR_ENTRY" | jq -r '.branch // empty')
if [[ -z "$PR_NUMBER" || -z "$PR_REPO" || -z "$PR_BRANCH" ]]; then
if [[ -z "$PR_NUMBER" || -z "$PR_REPO_URL" || -z "$PR_BRANCH" ]]; then
echo "Skipping invalid PR entry: $PR_ENTRY"
continue
fi
echo "Processing PR #$PR_NUMBER from $PR_REPO:$PR_BRANCH"
echo "Processing PR #$PR_NUMBER from $PR_REPO_URL:$PR_BRANCH"
# Fork-Repo klonen (anstatt community-scripts)
REPO_URL="https://x-access-token:${{ env.GH_ACCESS_TOKEN }}@github.com/$PR_REPO/ProxmoxVE.git"
# Sicherstellen, dass der Fork existiert
if ! git ls-remote --exit-code "$REPO_URL" &>/dev/null; then
echo "Repository $PR_REPO/ProxmoxVE does not exist or is private. Skipping..."
continue
fi
# Fork-Repo klonen
REPO_URL="${PR_REPO_URL/github.com/x-access-token:${{ env.GH_ACCESS_TOKEN }}@github.com}"
echo "Cloning $REPO_URL"
git clone --depth=1 "$REPO_URL"
cd ProxmoxVE || exit 1
# Alle Branches abrufen & den richtigen Branch auschecken
# Sicherstellen, dass der Branch existiert
git fetch origin "$PR_BRANCH" || { echo "Branch $PR_BRANCH does not exist in fork. Skipping..."; cd ..; rm -rf ProxmoxVE; continue; }
git checkout "$PR_BRANCH"