Skip to content

Commit

Permalink
chore: Replace changed-files with path-filter (#1460)
Browse files Browse the repository at this point in the history
Co-authored-by: Hisar Balik <[email protected]>
  • Loading branch information
Stanislav Khalash and hisarbalik committed Sep 19, 2024
1 parent a163d68 commit 193bb01
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 101 deletions.
42 changes: 6 additions & 36 deletions .github/workflows/pr-code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,20 @@ on:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- 'dependencies/**'
- '**/*.md'
- 'OWNERS'
- 'CODEOWNERS'
workflow_dispatch:

env:
GITLEAKS_VERSION: 8.18.2

jobs:
# This is a workaround to bypass the limitations of the workflow path filter:
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
check-changed-files:
outputs:
check: ${{ steps.changed-files.outputs.any_modified }}
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Get changed files
uses: tj-actions/changed-files@6b2903bdce6310cfbddd87c418f253cf29b2dec9
id: changed-files
with:
files_ignore: |
docs/**
**/*.md
OWNERS
CODEOWNERS
- name: List changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' >> $GITHUB_STEP_SUMMARY

unit-tests:
runs-on: ubuntu-latest
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -52,9 +31,6 @@ jobs:

lint:
runs-on: ubuntu-latest
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -67,9 +43,6 @@ jobs:

coverage:
runs-on: ubuntu-latest
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -82,9 +55,6 @@ jobs:

gitleaks:
runs-on: ubuntu-latest
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
43 changes: 6 additions & 37 deletions .github/workflows/pr-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,16 @@ on:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- 'dependencies/**'
- '**/*.md'
- 'OWNERS'
- 'CODEOWNERS'
workflow_dispatch:

jobs:
# This is a workaround to bypass the limitations of the workflow path filter:
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
check-changed-files:
outputs:
check: ${{ steps.changed-files.outputs.any_modified }}
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Get changed files
uses: tj-actions/changed-files@6b2903bdce6310cfbddd87c418f253cf29b2dec9
id: changed-files
with:
files_ignore: |
docs/**
dependencies/**
**/*.md
OWNERS
CODEOWNERS
- name: List changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' >> $GITHUB_STEP_SUMMARY

e2e:
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -72,9 +50,6 @@ jobs:
job-name: ${{ github.job }}-${{ matrix.ginkgo-labels }}

e2e-dev:
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -103,9 +78,6 @@ jobs:
job-name: ${{ github.job }}-${{ matrix.ginkgo-labels }}

e2e-istio:
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand All @@ -132,9 +104,6 @@ jobs:
job-name: ${{ github.job }}

e2e-self-mon:
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
strategy:
fail-fast: false
matrix:
Expand Down
34 changes: 6 additions & 28 deletions .github/workflows/pr-lifecycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,16 @@ on:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- 'dependencies/**'
- '**/*.md'
- 'OWNERS'
- 'CODEOWNERS'
workflow_dispatch:

jobs:
# This is a workaround to bypass the limitations of the workflow path filter:
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
check-changed-files:
outputs:
check: ${{ steps.changed-files.outputs.any_modified }}
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Get changed files
uses: tj-actions/changed-files@6b2903bdce6310cfbddd87c418f253cf29b2dec9
id: changed-files
with:
files_ignore: |
docs/**
dependencies/**
**/*.md
OWNERS
CODEOWNERS
- name: List changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' >> $GITHUB_STEP_SUMMARY

manager-upgrade:
needs:
- check-changed-files
if: ${{ needs.check-changed-files.outputs.check == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand Down

0 comments on commit 193bb01

Please sign in to comment.