Bot releases are visible (Hide)
Full Changelog: https://github.com/matifali/update-coder-template/compare/v3.0.0...v3.0.1
Published by github-actions[bot] about 1 year ago
Moved to a composite workflow from Dockerfile.
Directory Specification (dir): Users can now specify the template directory name. This allows for more flexibility, especially when the directory name differs from the default.
Version Naming (name): Allows users to provide a specific version name for the template, such as a commit hash or release tag. Provides more flexibility in versioning.
Activation Control (activate): Users can decide whether the current template version should be marked as active.
Update Message (message): An update message can be provided to better describe the update details.
Template Creation (create): New toggle to decide whether a new template should be created if it doesn't exist.
Enhanced Scripting:
Message Quoting: Updated the action's underlying scripting to ensure the update message is properly quoted. This helps in preserving message integrity, especially when it contains spaces or special characters.
Code Refinements: Various refinements and optimizations in the action's codebase to improve performance and reduce potential errors.
Update coder templates automatically
Create a GitHub secret named CODER_SESSION_TOKEN
with your coder session token
You can generate a long lived session token by running the following command in your browser console while logged into Coder with a Template Admin or Owner role.
coder token create --lifetime 8760h --name "GitHub Actions"
Create a .github/workflows/push-coder-template.yaml
file and use one of the examples below.
Name | Description | Default |
---|---|---|
url |
Required The url of coder deployment (e.g. https://dev.coder.com). | - |
coder_session_token |
Required The session token of coder. | - |
id |
Required The id of template. | - |
dir |
Required The directory of the template that contains main.tf file |
- |
name |
New version name for the template. | Autogenerated name by Coder |
activate |
Activate the new template version. | true |
create |
Creates a new template if it does not exist | true |
message |
Update message (similar to commit messages) | - |
dry_run |
Dry run mode. | false |
Update a Coder template with the latest commit hash as the version name, commit message as the update message and mark this as active.
name: Update Coder Template
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get latest commit hash
id: latest_commit
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get commit title
id: commit_title
run: echo "title=$(git log -1 --pretty=%B)" >> $GITHUB_OUTPUT
- name: Update Coder Template
uses: matifali/update-coder-template@v3
with:
id: "my-template"
dir: "my-template"
url: "https://coder.example.com"
name: "${{ steps.latest_commit.outputs.hash }}"
message: "${{ steps.commit_title.outputs.title }}"
coder_session_token: ${{ secrets.CODER_SESSION_TOKEN }}
Update a Coder template with a random version name without activating.
name: Update Coder Template
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update Coder Template
uses: matifali/update-coder-template@v3
with:
id: "my-template"
dir: "my-template"
url: "https://coder.example.com"
activate: "false"
coder_session_token: ${{ secrets.CODER_SESSION_TOKEN }}
Full Changelog: https://github.com/matifali/update-coder-template/compare/v2.0.8...v3.0.0
Published by matifali about 1 year ago
Published by matifali over 1 year ago
Published by matifali over 1 year ago
Published by matifali over 1 year ago
Published by matifali over 1 year ago
Published by matifali over 1 year ago
Published by matifali over 1 year ago
--activate
flag to push inactive templates by @matifali in https://github.com/matifali/update-coder-template/pull/1
Full Changelog: https://github.com/matifali/update-coder-template/compare/v1...v2.0.4
Published by github-actions[bot] over 1 year ago
--activate
flag to push inactive templates by @matifali in https://github.com/matifali/update-coder-template/pull/1
Full Changelog: https://github.com/matifali/update-coder-template/compare/v1.0.3...v2.0.3
Published by matifali over 1 year ago
Published by matifali almost 2 years ago