You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Template.PowerShell.ScriptModule/TemplateRepoFiles/ReadMe.md
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ In order to publish the module to the gallery, you need to get an API key.
29
29
If you already have an API key that you want to use, you can skip to the next step.
30
30
31
31
> [!CAUTION]
32
-
> It is considered best practice to use a separate API key for each module you publish.
32
+
> It is considered best practice to use a different API key for each module you publish.
33
33
> It reduces the impact scope if one of the API keys becomes compromised.
34
34
35
35
If you will be publishing the module to a custom PowerShell Gallery feed, you will need to get an API key for that feed. Otherwise, follow the steps below.
@@ -44,7 +44,9 @@ If you will be publishing the module to a custom PowerShell Gallery feed, you wi
44
44
1. Ensure the `Push new packages and package versions` scope is selected.
45
45
1. For the `Glob Pattern` enter the name of your module: `__NewModuleName__`
46
46
1. Click the `Create` button to create the API key.
47
-
1. Click the `Copy` button on the new API key to copy it to your clipboard, as you will need it for the next step.
47
+
1. Click the `Copy` button on the new API key to copy it to your clipboard, as you will need it for the next section.
48
+
49
+
You may want to leave this page open in your browser until you have the API key saved in your repository secrets in the next section.
48
50
49
51
</details>
50
52
@@ -63,19 +65,20 @@ If using GitHub Actions for your CI/CD workflows, perform the following steps to
63
65
1. In the left-hand menu, in the `Security` section, click on `Secrets and variables` and select `Actions`.
64
66
1. In the `Secrets` tab click the `New repository secret` button.
65
67
1. Set the `Name` to: `POWERSHELL_GALLERY_API_KEY`
66
-
1. Set the `Secret` to the API key value that you copied in the previous step.
68
+
1. Set the `Secret` to the API key value that you copied in the previous section.
67
69
68
70
Next we want to create an Environment so that stable module versions require manual approval before being published to the gallery:
69
71
72
+
1. You should still be in the `Settings` section of your repository.
70
73
1. In the left-hand menu, in the `Environments` section, click on `Environments`.
71
74
1. Click the `New environment` button.
72
-
1. Set the `Name` to: `production`
75
+
1. Set the `Name` to (all lowercase): `production`
73
76
1. Click the `Configure environment` button.
74
-
1. Check the `Required reviewers` checkbox and add the appropriate reviewers.
77
+
1. Check the `Required reviewers` checkbox and add the usernames of the people allowed to approve new stable version deployments.
75
78
1. Click the `Save protection rules` button.
76
79
77
-
If your account does not meet [the requirements to use `Environments`](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment), the `Environments` section will not be available.
78
-
You will instead need to use[the Manual Workflow Approval action](https://github.com/marketplace/actions/manual-workflow-approval).
80
+
If your GitHub account does not meet [the requirements to use `Environments`](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment), the `Environments` section will not be available.
81
+
You will instead need to add[the Manual Workflow Approval action](https://github.com/marketplace/actions/manual-workflow-approval) to [the deployment workflow](/.github/workflows/build-test-and-deploy-powershell-module.yml) to block deployments until they are approved.
0 commit comments