Skip to content

Commit

Permalink
Add base ref for policy unit tests (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtracey93 authored Aug 4, 2023
1 parent 53f886c commit fb67f44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/actions-pester/PolicyPesterTestHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ function Get-PolicyFiles
[String]$PolicySetDir = "$($env:POLICYSET_DIR)",

[Parameter()]
[String]$PRBranch = "$($env:GITHUB_HEAD_REF)"
[String]$PRBranch = "$($env:GITHUB_HEAD_REF)",

[Parameter()]
[String]$BaseBranch = "$($env:GITHUB_BASE_REF)"
)

$PolicyFiles = @(git diff --diff-filter=$DiffFilter --name-only origin/main $PRBranch -- $PolicyDir)
$PolicySetsFiles = @(git diff --diff-filter=$DiffFilter --name-only origin/main $PRBranch -- $PolicySetDir)
$PolicyFiles = @(git diff --diff-filter=$DiffFilter --name-only origin/$BaseBranch $PRBranch -- $PolicyDir)
$PolicySetsFiles = @(git diff --diff-filter=$DiffFilter --name-only origin/$BaseBranch $PRBranch -- $PolicySetDir)

$PolicyAndSetFiles = $PolicyFiles + $PolicySetsFiles

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Lint eslzArm directory
uses: docker://github/super-linter:v4.9.5
env:
# Lint all code
VALIDATE_ALL_CODEBASE: true
# Only lint changed files
VALIDATE_ALL_CODEBASE: false
# Need to define main branch as default
# is set to master in super-linter
DEFAULT_BRANCH: main
Expand All @@ -51,8 +51,8 @@ jobs:
- name: Lint src directory
uses: docker://github/super-linter:v4.9.5
env:
# Lint all code
VALIDATE_ALL_CODEBASE: true
# Only lint changed files
VALIDATE_ALL_CODEBASE: false
# Need to define main branch as default
# is set to master in super-linter
DEFAULT_BRANCH: main
Expand Down

0 comments on commit fb67f44

Please sign in to comment.