Skip to content

Parallel processing + Set-Secret #111

@MariusStorhaug

Description

@MariusStorhaug

Summary of the new feature / enhancement

As a user I want to use a secret vault to locally store all the Installation Access Tokens for a GitHub Apps in a secure way locally on a runner using PowerShell, so that I can automate interactions with a set of organizations in GitHub.

As each Installation Access Token is retrieved via a REST API, I want my Connect-GitHubApp function to be able to iterate over a set of installations (a list of 100's of IDs) to get the token and store it in the secret vault using 'Set-Secret'

Example that shows the issue:

1..100 | ForEach-Object -ThrottleLimit ([environment]::ProcessorCount * 2) -Parallel {
    Set-Secret -Name "secret-$" -Secret "value-$"
}

From a discussion on the PowerShell discord, "josh" suggested that its due to it writing to a single file, so I guess splitting it up to be a secret pr file might be a way to fix it, but I know too little about how its technically implemented under the hood to make a good suggestion on how to add support for multiple simultaneous writes to individual secrets.

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions