Skip to content

Commit

Permalink
KX-11806 - add job dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertZ authored and RobertZ committed Mar 15, 2024
1 parent 9a75fd3 commit fde2cc3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ jobs:
fetch-depth: 0

- name: Get changed files
if: github.event_name == 'push'
run: |
$CHANGED_FILES = (git diff --name-only ${{ github.event.before }} ${{ github.sha }}) -replace '\n',' '
echo "CHANGED_FILES=$CHANGED_FILES" | Out-File -FilePath $Env:GITHUB_ENV -Append
- name: Get changed files in PR
if: github.event_name == 'pull_request'
run: |
$CHANGED_FILES = (git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }}) -replace '\n',' '
if ($env:GITHUB_EVENT_NAME -eq "pull_request") {
$BASE_REF = "origin/${{ github.base_ref }}"
} else {
$BASE_REF = "${{ github.event.before }}"
}
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} --depth=1
$CHANGED_FILES = (git diff --name-only $BASE_REF ${{ github.sha }}) -replace '\n',' '
echo "CHANGED_FILES=$CHANGED_FILES" | Out-File -Append -FilePath $Env:GITHUB_ENV
- name: Run dotnet format
Expand All @@ -68,6 +67,8 @@ jobs:
build-and-test:
name: Build and test
runs-on: windows-latest

needs: dotnet-format

defaults:
run:
Expand Down

0 comments on commit fde2cc3

Please sign in to comment.