Skip to content

Commit

Permalink
[fundamental] Touch result file for fork repository (#3481)
Browse files Browse the repository at this point in the history
# Description

CI "Compliance Check" starts to fail recently (one example: #3478 ); the
root cause is that the PoliCheck does not support fork repository, so
the step that generates result tsv will be skipped, resulting in the
following step that will consume the tsv file break.

This PR targets to fix this issue by checking the tsv file first, and
create an empty one if the file does not exist; then the following step
will regard everything is fine and goes on as before.

# All Promptflow Contribution checklist:
- [x] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [x] Title of the pull request is clear and informative.
- [x] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [x] Pull request includes test coverage for the included changes.

---------

Co-authored-by: Zhengfei Wang <[email protected]>
  • Loading branch information
zhengfeiwang and Zhengfei Wang authored Jun 28, 2024
1 parent 35e4b26 commit bfdceed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/pipelines/compliance_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ steps:
result: '$(sourceLocation)\scripts\compliance-check\result.tsv'
optionsXCLASS: 'Geopolitical'

- task: PowerShell@2
inputs:
targetType: inline
script: |
if (-Not (Test-Path "$(sourceLocation)/scripts/compliance-check/result.tsv")) {
Write-Host "PoliCheck@2 (previous step) is not supported for forked GitHub repository, which will break the following step."
Write-Host "So as a workaround, this step will create an empty result.tsv file."
New-Item -ItemType Directory -Force -Path "$(sourceLocation)/scripts/compliance-check"
Set-Location "$(sourceLocation)/scripts/compliance-check"
New-Item -ItemType File -Name "result.tsv"
}
displayName: 'Workaround for fork repository'

- task: PowerShell@2
inputs:
targetType: 'filePath'
Expand Down

0 comments on commit bfdceed

Please sign in to comment.