File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8181 uses : ./.github/workflows/reusable-integration-test.yml
8282 with :
8383 target-branch : ${{ inputs.target-branch }}
84+ has-integration-label : ${{ contains(github.event.pull_request.labels.*.name, 'ci/integrations') }}
8485 secrets :
8586 PIPELINE_GITHUB_APP_ID : ${{ secrets.PIPELINE_GITHUB_APP_ID }}
8687 PIPELINE_GITHUB_APP_PRIVATE_KEY : ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
Original file line number Diff line number Diff line change 3838 required : false
3939 type : string
4040 default : ' datadog-api-spec'
41+ has-integration-label :
42+ description : ' Whether the calling PR has ci/integrations label'
43+ required : false
44+ type : boolean
45+ default : false
4146 secrets :
4247 PIPELINE_GITHUB_APP_ID :
4348 required : false
6570 !contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
6671 !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/') &&
6772 contains(github.event.pull_request.labels.*.name, 'ci/integrations')) ||
68- github.event_name == 'schedule'
73+ github.event_name == 'schedule' ||
74+ (github.event_name == 'workflow_call' && inputs.has-integration-label)
6975 services :
7076 datadog-agent :
7177 image : gcr.io/datadoghq/agent:latest
Original file line number Diff line number Diff line change @@ -53,14 +53,21 @@ jobs:
5353 with :
5454 path : ~/.cache/pre-commit
5555 key : pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
56+ - name : Determine pre-commit range
57+ id : commit_range
58+ run : |
59+ FROM_REF=$(git merge-base HEAD origin/master)
60+ echo "from_ref=$FROM_REF" >> $GITHUB_OUTPUT
61+ echo "to_ref=HEAD" >> $GITHUB_OUTPUT
62+ echo "Pre-commit will check from $FROM_REF to HEAD"
5663 - id : pre_commit
5764 name : Run pre-commit
5865 if : github.event.action != 'closed' && github.event.pull_request.merged != true
5966 run : |
6067 pre-commit run --from-ref "${FROM_REF}" --to-ref "${TO_REF}" --show-diff-on-failure --color=always
6168 env :
62- FROM_REF : ${{ github.event.pull_request.base.sha }}
63- TO_REF : ${{ github.event.pull_request.head.sha }}
69+ FROM_REF : ${{ steps.commit_range.outputs.from_ref }}
70+ TO_REF : ${{ steps.commit_range.outputs.to_ref }}
6471 - name : Commit changes
6572 if : failure() && inputs.enable-commit-changes && github.event.pull_request.head.repo.full_name == github.repository
6673 run : |-
You can’t perform that action at this time.
0 commit comments