Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 7892 (Azure#28944)
Browse files Browse the repository at this point in the history
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#7892 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: Ben Broderick Phillips <[email protected]>
  • Loading branch information
azure-sdk and benbp authored Mar 15, 2024
1 parent d2dccfa commit 0108b2b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion eng/common/pipelines/templates/steps/bypass-local-dns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ steps:
condition: |
and(
succeededOrFailed(),
contains(variables['OSVmImage'], 'ubuntu'),
or(contains(variables['OSVmImage'], 'ubuntu'),contains(variables['OSVmImage'], 'linux')),
eq(variables['Container'], '')
)
23 changes: 6 additions & 17 deletions eng/common/pipelines/templates/steps/git-push-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,14 @@ parameters:
SkipCheckingForChanges: false

steps:
- pwsh: |
echo "git add -A"
git add -A
echo "git diff --name-status --cached --exit-code"
git diff --name-status --cached --exit-code
if ($LastExitCode -ne 0) {
echo "##vso[task.setvariable variable=HasChanges]$true"
echo "Changes detected so setting HasChanges=true"
}
else {
echo "##vso[task.setvariable variable=HasChanges]$false"
echo "No changes so skipping code push"
}
- task: PowerShell@2
displayName: Check for changes
condition: and(succeeded(), eq(${{ parameters.SkipCheckingForChanges }}, false))
workingDirectory: ${{ parameters.WorkingDirectory }}
ignoreLASTEXITCODE: true
inputs:
pwsh: true
workingDirectory: ${{ parameters.WorkingDirectory }}
filePath: ${{ parameters.ScriptDirectory }}/check-for-git-changes.ps1
ignoreLASTEXITCODE: true

- pwsh: |
# Remove the repo owner from the front of the repo name if it exists there
Expand Down
14 changes: 14 additions & 0 deletions eng/common/scripts/check-for-git-changes.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
echo "git add -A"
git add -A

echo "git diff --name-status --cached --exit-code"
git diff --name-status --cached --exit-code

if ($LastExitCode -ne 0) {
echo "##vso[task.setvariable variable=HasChanges]$true"
echo "Changes detected so setting HasChanges=true"
}
else {
echo "##vso[task.setvariable variable=HasChanges]$false"
echo "No changes so skipping code push"
}
7 changes: 4 additions & 3 deletions eng/common/testproxy/publish-proxy-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ parameters:

steps:
- pwsh: |
Copy-Item -Path "${{ parameters.rootFolder }}/test-proxy.log" -Destination "${{ parameters.rootFolder }}/proxy.log"
New-Item -ItemType Directory -Force "${{ parameters.rootFolder }}/proxy-logs"
Copy-Item -Path "${{ parameters.rootFolder }}/test-proxy.log" -Destination "${{ parameters.rootFolder }}/proxy-logs/proxy.log"
displayName: Copy Log File
condition: succeededOrFailed()
- template: ../pipelines/templates/steps/publish-artifact.yml
parameters:
ArtifactName: "$(System.StageName)-$(System.JobName)-$(System.JobAttempt)-proxy-logs"
ArtifactPath: "${{ parameters.rootFolder }}/proxy.log"
ArtifactPath: "${{ parameters.rootFolder }}/proxy-logs"

- pwsh: |
Remove-Item -Force ${{ parameters.rootFolder }}/proxy.log
Remove-Item -Force ${{ parameters.rootFolder }}/proxy-logs/proxy.log
displayName: Cleanup Copied Log File
condition: succeededOrFailed()

0 comments on commit 0108b2b

Please sign in to comment.