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

chore(workflows): fix undesirable workflows git #31912

Merged
merged 3 commits into from
Oct 11, 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
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
Loading