GitHub Action to build & publish your own dev container assets https://containers.dev
  • TypeScript 98.4%
  • JavaScript 0.9%
  • Shell 0.7%
Find a file
Josh Spicer c40c27d896
Update README with required permissions info (#219)
* Update README with required permissions info

Related: https://github.com/devcontainers/template-starter/pull/36 , https://github.com/microsoft/vscode/issues/226686#issuecomment-2312915430

* add pull request tips and setting a public tips

* grammar and style pass
2024-08-27 15:28:32 -07:00
.devcontainer Bump node from 16 to 20 (#207) 2024-01-30 11:30:17 -08:00
.github Update publish.yml (#215) 2024-02-16 09:40:58 -08:00
__tests__ Fixes devcontainer-feature.json with comment (#214) 2024-02-15 16:06:29 -08:00
src Fixes devcontainer-feature.json with comment (#214) 2024-02-15 16:06:29 -08:00
.gitattributes copy in v1 version of action 2022-06-02 23:16:54 +00:00
.gitignore Add repo tags for each published tag (#117) 2023-01-25 07:52:14 -08:00
.prettierignore copy in v1 version of action 2022-06-02 23:16:54 +00:00
.prettierrc.json support publishing templates and generating template docs 2022-06-22 21:43:25 +00:00
action.yml Bump node from 16 to 20 (#207) 2024-01-30 11:30:17 -08:00
CODE_OF_CONDUCT.md copy in v1 version of action 2022-06-02 23:16:54 +00:00
CODEOWNERS Adds CODEOWNERS file 2022-07-27 14:03:31 -07:00
jest.config.js validate devcontainer-feature.json schema (#121) 2022-12-27 09:04:04 -05:00
LICENSE Update attribution 2022-06-24 14:24:59 -07:00
package.json Fixes devcontainer-feature.json with comment (#214) 2024-02-15 16:06:29 -08:00
README.md Update README with required permissions info (#219) 2024-08-27 15:28:32 -07:00
SECURITY.md copy in v1 version of action 2022-06-02 23:16:54 +00:00
tsconfig.json validate devcontainer-feature.json schema (#121) 2022-12-27 09:04:04 -05:00
yarn.lock Fixes devcontainer-feature.json with comment (#214) 2024-02-15 16:06:29 -08:00

Development Container Action

devcontainers organization logo Development Container Action
A GitHub Action to publish development container assets.

This action is used to package and generate documentation for dev container Features and Templates.

Running this action will publish dev container Features and templates in accordance with following specifications:

This action is used in the devcontainer/features repo, in the release.yaml workflow.

Usage

See the action.yml for available options.

To best get started, create your own repo from the devcontainers/feature-starter or devcontainers/template-starter repos, customize the provided examples, and trigger the release.yaml workflow.

Permissions

Workflow permissions

Running this action requires the following permissions be granted:

  • packages: write
  • contents: write
  • pull-requests: write

For example:

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"

Enable creation of pull requests

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 is enabled in your repo settings.

Optional: Setting Features/Templates as 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:

https://github.com/<YOUR_GITHUB_USERNAME>?tab=packages

Pinning devcontainer CLI version

This action heavily relies on the devcontainers/cli for various operations. By default, this action will fetch the latest version published to npm. The devcontainer-cli-version property can be used to pin to a specific CLI release. Eg:

- name: "Publish Features"
  uses: devcontainers/action@v1
  with:
    publish-features: "true"
    base-path-to-features: "./src"
    devcontainer-cli-version: "0.53.0"

The changelog for the CLI can always be found here: https://github.com/devcontainers/cli/blob/main/CHANGELOG.md

Design

Internally, this GitHub Action will fetch the latest published version of the Dev Container CLI and execute the appropriate CLI commands - namely devcontainer features publish and devcontainer templates publish.