Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Don't create multiple whitespace Prs #1495

Merged
merged 1 commit into from
Dec 27, 2024
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
15 changes: 13 additions & 2 deletions .github/workflows/apply-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push changes if needed
- name: Check for existing PR
if: env.FIX_NEEDED == 'true'
id: check_pr
run: |
EXISTING_PR=$(gh pr list --state open --search "Fix whitespace issues" --json number -q '.[].number')
if [[ -n "$EXISTING_PR" ]]; then
echo "EXISTING_PR=true" >> $GITHUB_ENV
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push changes if needed
if: env.FIX_NEEDED == 'true' && env.EXISTING_PR != 'true'
id: create_branch
run: |
git config user.name "github-actions[bot]"
Expand All @@ -49,7 +60,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Open Pull Request
if: env.FIX_NEEDED == 'true'
if: env.FIX_NEEDED == 'true' && env.EXISTING_PR != 'true'
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ env.branch_name }}
Expand Down
Loading