Skip to content

Commit c40c27d

Browse files
authored
Update README with required permissions info (#219)
* Update README with required permissions info Related: devcontainers/template-starter#36 , microsoft/vscode#226686 (comment) * add pull request tips and setting a public tips * grammar and style pass
1 parent 85693cd commit c40c27d

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,51 @@ See the [action.yml](https://github.com/devcontainers/action/blob/main/action.ym
2323

2424
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.
2525

26+
### Permissions
27+
28+
#### Workflow permissions
29+
30+
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:
31+
32+
- `packages: write`
33+
- `contents: write`
34+
- `pull-requests: write`
35+
36+
For example:
37+
38+
```yaml
39+
jobs:
40+
deploy:
41+
if: ${{ github.ref == 'refs/heads/main' }}
42+
runs-on: ubuntu-latest
43+
permissions:
44+
packages: write
45+
contents: write
46+
pull-requests: write
47+
steps:
48+
- uses: actions/checkout@v3
49+
50+
- name: "Publish Templates"
51+
uses: devcontainers/action@v1
52+
with:
53+
publish-templates: "true"
54+
base-path-to-templates: "./src"
55+
```
56+
57+
#### Enable creation of pull requests
58+
59+
This action will auto-generate documentation and create a pull request of those changes for your review.
60+
61+
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.
62+
63+
#### Optional: Setting Features/Templates as public
64+
65+
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.
66+
67+
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:
68+
69+
`https://github.com/<YOUR_GITHUB_USERNAME>?tab=packages`
70+
2671
### Pinning `devcontainer` CLI version
2772

2873
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:

0 commit comments

Comments
 (0)