-
Notifications
You must be signed in to change notification settings - Fork 150
Freddydk/avoidallsecrets #1735
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
Freddydk/avoidallsecrets #1735
Conversation
…nto avoidallsecrets
…nto avoidallsecrets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors how secrets are retrieved by introducing a step to determine exactly which secrets are needed and only reading missing ones from Azure KeyVault. It also updates existing workflows to wire the new DetermineSecrets action into ReadSecrets, removes redundant asterisk-based encryption markers in secrets
lists, and refactors ReadSecrets and DetermineSecrets scripts for the new flow.
- Add
DetermineSecrets
action calls beforeReadSecrets
in all workflows - Change
ReadSecrets
invocation to use a dynamic format string and indexed secret outputs (S0–S31) - Remove
*
encryption markers fromsecrets:
lists and update PowerShell scripts to fetch missing secrets from KeyVault
Reviewed Changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
Templates/AppSource App/.github/workflows/PublishToAppSource.yaml | Inserted DetermineSecrets step and updated ReadSecrets binding to use format(…,toJSON(secrets[env.S0]),…) |
Templates/AppSource App/.github/workflows/NextMinor.yaml | Removed * prefixes in secrets: list and added DetermineSecrets invocation |
Actions/RunPipeline/RunPipeline.ps1 | Fixed SecureString conversion flags and removed asterisk markers from pipeline secrets list |
Actions/DetermineSecrets/DetermineSecrets.ps1 | New script to collect requested secrets, map them, and emit FORMATSTR /S0–S31 outputs |
Actions/ReadSecrets/ReadSecrets.ps1 | Refactored to loop over indexed secrets, fetch missing ones from KeyVault, and mask them |
Actions/ReadSecrets/ReadSecretsHelper.psm1 | Simplified helper by removing old GetSecret/GetGithubSecret logic and adjusting KeyVault credential parsing |
Comments suppressed due to low confidence (2)
Templates/AppSource App/.github/workflows/PublishToAppSource.yaml:79
- The DetermineSecrets action declares its output as
FORMATSTR
but this workflow referencesformatStr
, which may not match and could result in empty or broken secrets input. Ensure output casing and key name match exactly.
gitHubSecrets: ${{ format(steps.DetermineSecrets.outputs.formatStr,toJSON(secrets[env.S0]),… ) }}
Templates/AppSource App/.github/workflows/NextMinor.yaml:109
- The asterisks (
*
) markingcodeSignCertificatePassword
andkeyVaultCertificatePassword
as encrypted were removed, which may disable encryption for these sensitive values. Confirm whether this change is intentional.
secrets: 'licenseFileUrl,codeSignCertificateUrl,codeSignCertificatePassword,...'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget release notes.
Co-authored-by: freddydk <[email protected]>
Avoid transfering all secrets available to the repository to ReadSecrets.
Instead Determine the secrets needed and read/transfer them.
Also refactor ReadSecrets to only attempt to read the missing secrets from Azure KeyVault as secrets from GitHub has already been resolved.
TODO