fix the reusable precommit so it runs on the correct commit sha #2829
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The reusable pre-commit workflows across all client repositories were failing when called from the datadog-api-spec repository due to a cross-repository SHA mismatch issue. The workflows were using
github.event.pull_request.base.sha
andgithub.event.pull_request.head.sha
which refer to commits in the spec repository, but the workflows check out the client repository. This caused pre-commit to fail because these commit SHAs don't exist in the client repository.This fix is essential for:
Changes
Modified Files
datadog-api-client-typescript/.github/workflows/reusable-pre-commit.yml
: Added merge-base commit range determinationTests
This will be tested by referencing this version of the workflow in a spec PR.