Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtime assignment of SkipCheckingForChanges #3683

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion eng/common/pipelines/templates/steps/git-push-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,22 @@ steps:
echo "##vso[task.setvariable variable=HasChanges]$false"
echo "No changes so skipping code push"
}

# Conditions determined that SkipCheckingForChanges is 'false', set this
# as a variable which can be passed into the "Push Changes" step
echo "##vso[task.setvariable variable=SkipCheckingForChanges]false"
displayName: Check for changes
condition: and(succeeded(), eq(${{ parameters.SkipCheckingForChanges }}, false))
workingDirectory: ${{ parameters.WorkingDirectory }}
ignoreLASTEXITCODE: true

- pwsh: |
# Checking for changes was skipped, set a variable which can be passed into
# the "Push Changes" step
Write-Host "##vso[task.setvariable variable=SkipCheckingForChanges]true"
condition: and(succeeded(), eq(${{ parameters.SkipCheckingForChanges }}, true))
displayName: Set SkipCheckingForChanges to true

- pwsh: |
# Remove the repo owner from the front of the repo name if it exists there
$repoName = "${{ parameters.TargetRepoName }}" -replace "^${{ parameters.TargetRepoOwner }}/", ""
Expand All @@ -39,6 +50,7 @@ steps:
condition: succeeded()
workingDirectory: ${{ parameters.WorkingDirectory }}

# $(SkipCheckingForChanges) is set in an earlier step
- task: PowerShell@2
displayName: Push changes
condition: and(succeeded(), eq(variables['HasChanges'], 'true'))
Expand All @@ -51,4 +63,4 @@ steps:
-CommitMsg "${{ parameters.CommitMsg }}"
-GitUrl "https://$(azuresdk-github-pat)@github.com/${{ parameters.BaseRepoOwner }}/$(RepoNameWithoutOwner).git"
-PushArgs "${{ parameters.PushArgs }}"
-SkipCommit $${{ parameters.SkipCheckingForChanges }}
-SkipCommit $$(SkipCheckingForChanges)