File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 81
81
uses : ./.github/workflows/reusable-integration-test.yml
82
82
with :
83
83
target-branch : ${{ inputs.target-branch }}
84
+ has-integration-label : ${{ contains(github.event.pull_request.labels.*.name, 'ci/integrations') }}
84
85
secrets :
85
86
PIPELINE_GITHUB_APP_ID : ${{ secrets.PIPELINE_GITHUB_APP_ID }}
86
87
PIPELINE_GITHUB_APP_PRIVATE_KEY : ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
Original file line number Diff line number Diff line change 38
38
required : false
39
39
type : string
40
40
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
41
46
secrets :
42
47
PIPELINE_GITHUB_APP_ID :
43
48
required : false
65
70
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
66
71
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/') &&
67
72
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)
69
75
services :
70
76
datadog-agent :
71
77
image : gcr.io/datadoghq/agent:latest
Original file line number Diff line number Diff line change @@ -53,14 +53,21 @@ jobs:
53
53
with :
54
54
path : ~/.cache/pre-commit
55
55
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"
56
63
- id : pre_commit
57
64
name : Run pre-commit
58
65
if : github.event.action != 'closed' && github.event.pull_request.merged != true
59
66
run : |
60
67
pre-commit run --from-ref "${FROM_REF}" --to-ref "${TO_REF}" --show-diff-on-failure --color=always
61
68
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 }}
64
71
- name : Commit changes
65
72
if : failure() && inputs.enable-commit-changes && github.event.pull_request.head.repo.full_name == github.repository
66
73
run : |-
You can’t perform that action at this time.
0 commit comments