move pre cleanup to main and add pre-if and post-if#484
Merged
YanaXu merged 1 commit intoAzure:masterfrom Sep 14, 2024
YanaXu:yanxu/remove_pre
Merged
move pre cleanup to main and add pre-if and post-if#484YanaXu merged 1 commit intoAzure:masterfrom YanaXu:yanxu/remove_pre
YanaXu merged 1 commit intoAzure:masterfrom
YanaXu:yanxu/remove_pre
Conversation
MoChilia
approved these changes
Sep 14, 2024
|
Thank you! |
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.
This PR is going to fix #426.
What are in this PR
prestep from Azure Login Action and add the "pre cleanup" tomainstep.AZURE_LOGIN_PRE_CLEANUPfor checking if "cleanup before login" is necessary. By default, "cleanup before login" is disabled, only whenAZURE_LOGIN_PRE_CLEANUPis set and is "true", "cleanup before login" will be run.AZURE_LOGIN_POST_CLEANUPfor checking if "post cleanup" is necessary. By default, "post cleanup" is enabled.Description of the issues we know about
1. If Azure CLI, PowerShell or Azure PowerShell are not pre-installed on runner but installed in the steps of the workflow, an warning will be thrown in the
prestep. E.g., "ephemeral self-hosted runners" as metioned in #426.2.
pre cleanuporpost cleanupare not necessary for GitHub-hosted runners since they are always clean.pre cleanupin a job.post cleanupdoes no harm. But it's also OK if users set envAZURE_LOGIN_POST_CLEANUPtofalseto skippost cleanupin case of GitHub-hosted runners.3. If Azure Login Action runs multiple times in a job, there will be multiple
preandpoststeps.presteps.post cleanupsteps are not necessary. Users can set envAZURE_LOGIN_POST_CLEANUPtotruefor only one Azure Login Action step and set envAZURE_LOGIN_POST_CLEANUPtofalsefor all other Azure Login Action steps.4. If there is a
ifin Azure Login Action and it doesn't match, Azure Login Action will be skipped but theprestep will still run.5. Composite Action does not support
prestep and will throw an warning.poststep will work well.6. Local Action (checkout the aciton and run it) does not support
prestep and will throw an warning.poststep will work well.Reference
prestep: Support pre and post steps in Composite Actions actions/runner#1478prestep: Warning:preexecution is not supported for local action from './' actions/typescript-action#564How to use