Skip to content

Commit

Permalink
chore(workflows): fix undesirable workflows git (#31912)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored Oct 11, 2024
1 parent 555066c commit b1e42a0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/undesirable-test-additions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ jobs:
fetch-depth: 0 # Fetch all history for comparison
sparse-checkout: true
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Check for undesirable code
run: |
#!/bin/bash
set -e
echo "### Fetching base branch for comparison..."
git fetch origin ${{ github.event.pull_request.base.ref }}
BASE_BRANCH=origin/${{ github.event.pull_request.base.ref }}
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
echo "Base branch is: $BASE_BRANCH"
echo "Current HEAD is: $(git rev-parse HEAD)"
BASE_BRANCH_REF=${{ github.event.pull_request.base.sha }}
echo "Base branch ref for this PR is: $BASE_BRANCH_REF"
Expand All @@ -44,7 +41,7 @@ jobs:
fi
echo "### Calculating file changes in '__fixtures__' directories..."
git diff --name-status $BASE_BRANCH..HEAD > diff_name_status.txt
git diff --name-status $BASE_BRANCH_REF > diff_name_status.txt
echo "### Processing added files in '__fixtures__' directories..."
ADDED_FIXTURES=$(grep '^A' diff_name_status.txt | awk '{print $2}' | grep '/__fixtures__/' || true)
Expand Down

0 comments on commit b1e42a0

Please sign in to comment.