From 34897f7352776965f42b87eaf5816e592ee2621c Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Tue, 27 Aug 2024 11:46:01 -0700 Subject: [PATCH 1/4] Update README with required permissions info Related: https://github.com/devcontainers/template-starter/pull/36 , https://github.com/microsoft/vscode/issues/226686#issuecomment-2312915430 --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 057e536..144c5b3 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,35 @@ See the [action.yml](https://github.com/devcontainers/action/blob/main/action.ym To best get started, create your own repo from the [`devcontainers/feature-starter`](https://github.com/devcontainers/feature-starter) or [`devcontainers/template-starter`](https://github.com/devcontainers/template-starter) repos, customize the provided examples, and trigger the `release.yaml` workflow. +### Permissions + +Running this action requires the following [permissions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token) be granted: + +- `packages: write` +- `contents: write` +- `pull-requests: write` + +For example: + +```yaml +jobs: + deploy: + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + permissions: + packages: write + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v3 + + - name: "Publish Templates" + uses: devcontainers/action@v1 + with: + publish-templates: "true" + base-path-to-templates: "./src" +``` + ### Pinning `devcontainer` CLI version This action heavily relies on the [devcontainers/cli](https://github.com/devcontainers/cli) for various operations. By default, this action will fetch the latest version published to [npm](https://www.npmjs.com/package/@devcontainers/cli). The `devcontainer-cli-version` property can be used to pin to a specific CLI release. Eg: From 27ac120e55d8169e3312b59dde8cb9c74efcd6b0 Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Tue, 27 Aug 2024 13:33:29 -0700 Subject: [PATCH 2/4] add pull request tips and setting a public tips --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 144c5b3..ce04ab5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ To best get started, create your own repo from the [`devcontainers/feature-start ### Permissions +#### Workflow permissions + Running this action requires the following [permissions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token) be granted: - `packages: write` @@ -52,6 +54,20 @@ jobs: base-path-to-templates: "./src" ``` +#### Enable creation of pull requests + +This action will auto-generate documentation and generate a pull request for your review. + +Ensure [**Allow GitHub Actions to create and approve pull requests**](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests) is enabled in your repo. + +#### Optional: Setting Features/Templates as public + +Features or Templates published to a registry are private by default. To share your Feature or Template with others outside your organization, you can update the visibility to public. + +To do so, publish your Feature or Template and navigate to its setting page. To see packages you have published to the GitHub Container Registry, navigate to the following URL: + +`https://github.com/?tab=packages` + ### Pinning `devcontainer` CLI version This action heavily relies on the [devcontainers/cli](https://github.com/devcontainers/cli) for various operations. By default, this action will fetch the latest version published to [npm](https://www.npmjs.com/package/@devcontainers/cli). The `devcontainer-cli-version` property can be used to pin to a specific CLI release. Eg: From 46e5989db2f753868693f9b7a221f6c159c9a139 Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Tue, 27 Aug 2024 15:27:06 -0700 Subject: [PATCH 3/4] grammar and style pass --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce04ab5..2d8fb2d 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ jobs: #### Enable creation of pull requests -This action will auto-generate documentation and generate a pull request for your review. +This action will auto-generate documentation and create a pull request of chose changes for your review. -Ensure [**Allow GitHub Actions to create and approve pull requests**](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests) is enabled in your repo. +Ensure [**Allow GitHub Actions to create and approve pull requests**](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests) is enabled in your repo settings. #### Optional: Setting Features/Templates as public -Features or Templates published to a registry are private by default. To share your Feature or Template with others outside your organization, you can update the visibility to public. +Features or Templates published to a registry are **private** by default. Access controls are managed by the registry. To share your Feature or Template with others outside your organization, you may update the visibility to public. To do so, publish your Feature or Template and navigate to its setting page. To see packages you have published to the GitHub Container Registry, navigate to the following URL: From a459cc78e8c0b21115258e113d675bdc1ee30f86 Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Tue, 27 Aug 2024 15:27:45 -0700 Subject: [PATCH 4/4] use real words --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d8fb2d..7edf4e2 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ jobs: #### Enable creation of pull requests -This action will auto-generate documentation and create a pull request of chose changes for your review. +This action will auto-generate documentation and create a pull request of those changes for your review. Ensure [**Allow GitHub Actions to create and approve pull requests**](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests) is enabled in your repo settings.