Skip to content
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
13 changes: 8 additions & 5 deletions .github/workflows/techapi-pr-validation-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,25 @@ jobs:
repository: GetTechAPI/TechAPI
ref: ${{ env.TECHAPI_HEAD_SHA }}
path: TechAPI
fetch-depth: 0
# Shallow; deepened to the merge base in the next-but-one step.
fetch-depth: 1

- name: Checkout TechAPI PR base
uses: actions/checkout@v4
with:
repository: GetTechAPI/TechAPI
ref: ${{ env.TECHAPI_BASE_SHA }}
path: TechAPI-base
fetch-depth: 0
fetch-depth: 1

- name: Pin PR base to the merge base
shell: bash
run: |
git -C TechAPI fetch --no-tags origin "$TECHAPI_BASE_SHA"
git -C TechAPI fetch --no-tags --depth=100 origin "$TECHAPI_BASE_SHA"
# Fall back to full history only if the PR branched from far back.
git -C TechAPI merge-base "$TECHAPI_BASE_SHA" HEAD >/dev/null 2>&1 || git -C TechAPI fetch --no-tags --unshallow origin
base_sha="$(git -C TechAPI merge-base "$TECHAPI_BASE_SHA" HEAD)"
git -C TechAPI-base fetch --no-tags origin "$base_sha"
git -C TechAPI-base fetch --no-tags --depth=1 origin "$base_sha"
git -C TechAPI-base checkout --detach "$base_sha"
echo "TECHAPI_DIFF_BASE=$base_sha" >> "$GITHUB_ENV"

Expand Down Expand Up @@ -161,7 +164,7 @@ jobs:
set +e
{
echo "## app.validate"
python -m app.validate
python -m app.validate --changed-since "$TECHAPI_DIFF_BASE"
echo "app_validate_status=$?"
} > validation.log 2>&1
app_status=$(grep "app_validate_status=" validation.log | tail -n 1 | cut -d= -f2)
Expand Down
Loading