Skip to content

chore: follow up fix to verify_library_generation #2721

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

Merged
merged 23 commits into from
May 3, 2024
Merged
Changes from 2 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
21 changes: 13 additions & 8 deletions .github/workflows/verify_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,30 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }} # Check out the head branch from the fork
fetch-depth: 0
- name: get changed directories in the pull request
id: get_changed_directories
shell: bash
run: |
set -ex
git checkout "${base_ref}" # Checkout a detached head, and then fetch the base ref to populate the detached head.
git fetch --no-tags --prune origin +${base_ref}:refs/remotes/origin/${base_ref}
git checkout "${head_ref}" # Checkout a detached head, and then fetch the head ref to populate the detached head.
git fetch --no-tags --prune origin +${head_ref}:refs/remotes/origin/${head_ref}
changed_directories="$(git diff --name-only ${base_ref} ${head_ref})"
echo "base_ref=${{ github.event.pull_request.base.ref }}"
echo "head_ref=${{ github.event.pull_request.head.ref }}"
echo "GITHUB_BASE_REF=${{ github.base_ref }}"
# Checkout base ref
git checkout ${{ github.event.pull_request.base.ref }}
echo "current branch after checking out base_ref is: $(git branch --show-current)"
# Checkout head ref
git fetch --no-tags --prune origin +${{ github.event.pull_request.head.ref }}:refs/remotes/origin/${{ github.event.pull_request.head.ref }}
git checkout ${{ github.event.pull_request.head.ref }}
echo "current branch after checking out head_ref is: $(git branch --show-current)"
# HEAD is a dynamic reference that points to the currently checked-out commit
changed_directories="$(git diff --name-only ${{ github.base_ref }} HEAD)"
if [[ ${changed_directories} =~ "library_generation/" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
env:
base_ref: ${{ github.event.pull_request.base.ref }}
head_ref: ${{ github.event.pull_request.head.ref }}
library-generation-integration-tests:
runs-on: ubuntu-22.04
needs: should-run-library-generation-tests
Expand Down
Loading