Skip to content

Commit

Permalink
close or when no changes
Browse files Browse the repository at this point in the history
deploy
  • Loading branch information
trueberryless committed Nov 25, 2024
1 parent d5e5fe7 commit 7a1bea9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,15 @@ jobs:
if git diff --cached --quiet; then
echo "No changes detected for $repo_name."
echo "Checking for an open PR for branch $branch_name..."
existing_pr=$(gh pr list --base main --head "$branch_name" --json number --jq '.[0].number')
if [ -n "$existing_pr" ]; then
echo "Found existing PR #$existing_pr. Closing it..."
gh pr comment "$existing_pr" -b "The branch has been updated. No changes detected for $repo_name."
gh pr close "$existing_pr"
fi
else
echo "Committing and pushing changes for $repo_name..."
git commit -m "Update GitHub template files"
Expand Down

0 comments on commit 7a1bea9

Please sign in to comment.