Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions .github/workflows/patternizer-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,10 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Check if the branch already exists on the remote
if git ls-remote --exit-code --heads origin "$BRANCH" >/dev/null 2>&1; then
git fetch origin "$BRANCH"
git checkout "$BRANCH"
git reset --hard origin/main
git checkout main -- .
# Re-run the update on the branch
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" quay.io/validatedpatterns/patternizer:latest update
git add -A
if git diff --cached --quiet; then
echo "Existing PR branch is already up to date"
exit 0
fi
else
git checkout -b "$BRANCH"
fi
# Create or reset the branch to current HEAD (main) and switch to it.
# -B handles both cases: creates if missing, resets if it exists.
# Staged changes are preserved since the target commit is the same.
git checkout -B "$BRANCH"

git commit -m "chore: update patternizer-managed files"
git push --force-with-lease origin "$BRANCH"
Expand Down
Loading