Repository navigation
Add docs for limiting input to changed files - #3991
Open
Ming (MaxonT) wants to merge 1 commit into
Open
Ming (MaxonT) wants to merge 1 commit into
Ming (MaxonT) wants to merge 1 commit into
Conversation
Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PSRule already supports this option, so this only adds the missing docs that #716 asked for. Happy to move the section or reword it if you'd like it somewhere else.
PR Summary
This adds a "Limiting input to changed files" section to
docs/creating-your-pipeline.mdfor theinput.ignoreUnchangedPathoption, plus a change log entry. PSRule added the option in v2.5.0, and the note on #716 says only the PSRule for Azure documentation was still missing.What the section says comes from the PSRule options documentation and source:
input.ignoreUnchangedPath: trueinps-rule.yamlignores files that have not changed (about_PSRule_Options.md,Input.IgnoreUnchangedPath).gitto compare the current commit with the base branch, which is detected from the build system or set withrepository.baseRef. With no base branch it compares withHEAD^(GitHelper.TryGetChangedFilesin microsoft/PSRule).PipelineBuilderBase.TryChangedFilesand its callers).fetch-depth: 0onactions/checkout) follows from the same code: a shallow checkout may not hold the base branch, so the comparison fails and all files are processed. That part is my reasoning from the source, I did not run it in a pipeline.The section follows the layout of the neighbouring "Limiting input to a specific path" section. It uses a
ps-rule.yamlexample instead of the tabbed GitHub Actions, Azure Pipelines and PowerShell examples, because the option is set inps-rule.yaml. I did not find it listed in themicrosoft/ps-ruleREADME inputs.Fixes #716
Testing
Checked:
#inputignoreunchangedpath,#repositorybaseref) exist on the page.markdownlint-cli2with the repository's.markdownlint.jsonreports nothing on the added lines. The two files already have findings on other lines, which I left alone.[12]and[13]are not used elsewhere in the file.Not run:
mkdocs build(mkdocs is not installed in my environment) and PSRule itself with the option in a pipeline, so the behaviour above comes from reading the PSRule source and documentation, not from a run.PR Checklist