Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/reusable-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
uses: ./.github/workflows/reusable-integration-test.yml
with:
target-branch: ${{ inputs.target-branch }}
has-integration-label: ${{ contains(github.event.pull_request.labels.*.name, 'ci/integrations') }}
secrets:
PIPELINE_GITHUB_APP_ID: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
PIPELINE_GITHUB_APP_PRIVATE_KEY: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/reusable-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ on:
required: false
type: string
default: 'datadog-api-spec'
has-integration-label:
description: 'Whether the calling PR has ci/integrations label'
required: false
type: boolean
default: false
secrets:
PIPELINE_GITHUB_APP_ID:
required: false
Expand Down Expand Up @@ -65,7 +70,8 @@ jobs:
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/') &&
contains(github.event.pull_request.labels.*.name, 'ci/integrations')) ||
github.event_name == 'schedule'
github.event_name == 'schedule' ||
(github.event_name == 'workflow_call' && inputs.has-integration-label)
services:
datadog-agent:
image: gcr.io/datadoghq/agent:latest
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/reusable-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,21 @@ jobs:
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Determine pre-commit range
id: commit_range
run: |
FROM_REF=$(git merge-base HEAD origin/master)
echo "from_ref=$FROM_REF" >> $GITHUB_OUTPUT
echo "to_ref=HEAD" >> $GITHUB_OUTPUT
echo "Pre-commit will check from $FROM_REF to HEAD"
- id: pre_commit
name: Run pre-commit
if: github.event.action != 'closed' && github.event.pull_request.merged != true
run: |
pre-commit run --from-ref "${FROM_REF}" --to-ref "${TO_REF}" --show-diff-on-failure --color=always
env:
FROM_REF: ${{ github.event.pull_request.base.sha }}
TO_REF: ${{ github.event.pull_request.head.sha }}
FROM_REF: ${{ steps.commit_range.outputs.from_ref }}
TO_REF: ${{ steps.commit_range.outputs.to_ref }}
- name: Commit changes
if: failure() && inputs.enable-commit-changes && github.event.pull_request.head.repo.full_name == github.repository
run: |-
Expand Down