mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-11 18:29:17 +00:00
Update update_json_date.yml
This commit is contained in:
parent
c40fc2b159
commit
a51e688388
14
.github/workflows/update_json_date.yml
vendored
14
.github/workflows/update_json_date.yml
vendored
@ -34,13 +34,19 @@ jobs:
|
||||
|
||||
while read -r PR_NUMBER; do
|
||||
echo "Processing PR #$PR_NUMBER"
|
||||
|
||||
|
||||
BRANCH_NAME=$(gh pr view $PR_NUMBER --json headRefName --jq '.headRefName')
|
||||
REPO_NAME="${{ github.repository }}"
|
||||
|
||||
# Prüfen, ob der Branch remote existiert
|
||||
if ! git ls-remote --exit-code origin "$BRANCH_NAME"; then
|
||||
echo "Branch $BRANCH_NAME für PR #$PR_NUMBER existiert nicht, überspringe..."
|
||||
continue
|
||||
fi
|
||||
|
||||
# Checkout PR Branch
|
||||
git fetch origin $BRANCH_NAME
|
||||
git checkout $BRANCH_NAME
|
||||
git fetch origin "$BRANCH_NAME"
|
||||
git checkout -B "$BRANCH_NAME" "origin/$BRANCH_NAME"
|
||||
|
||||
# Get newly added JSON files
|
||||
NEW_JSON_FILES=$(gh api repos/$REPO_NAME/pulls/$PR_NUMBER/files --jq '.[] | select(.status == "added") | .filename' | grep '^json/.*\.json$' || true)
|
||||
@ -66,7 +72,7 @@ jobs:
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git commit -am "Update date_created in new JSON files"
|
||||
git push origin $BRANCH_NAME
|
||||
git push origin "$BRANCH_NAME"
|
||||
else
|
||||
echo "No updates needed for PR #$PR_NUMBER"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user