Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update coder templates automatically

License

NotificationsYou must be signed in to change notification settings

matifali/update-coder-template

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UpdateCoder Template

Update coder templates automatically

Usage

Note

Please also check the offical Codersetup-action action.

  1. Create a GitHub secret namedCODER_SESSION_TOKEN with your coder session tokenYou can generate a long lived session token by running the following command in your browser console while logged into Coder with aTemplate Admin orOwner role.

      coder token create --lifetime 8760h --name"GitHub Actions"
  2. Create a.github/workflows/push-coder-template.yaml file and use one of the examples below.

Inputs

NameDescriptionDefault
urlRequired The url of coder deployment (e.g.https://dev.coder.com).-
coder_session_tokenRequired The session token of coder.-
idRequired The name of the template. Visible under Template Settings > General info in the coder deployment.-
dirRequired The directory of the template that containsmain.tf file-
nameNew version name for the template.Autogenerated name by Coder
activateActivate the new template version.true
messageUpdate message (similar to commit messages)-
dry_runDry run mode.false

Examples

  1. 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 Templateon:push:branches:      -mainjobs:update:runs-on:ubuntu-lateststeps:      -name:Checkoutuses:actions/checkout@v4      -name:Get latest commit hashid:latest_commitrun:echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT      -name:Get commit titleid:commit_titlerun:echo "title=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT      -name:Update Coder Templateuses:matifali/update-coder-template@v3with:id:my-templatedir:my-templateurl:https://coder.example.comname:${{ steps.latest_commit.outputs.hash }}message:${{ steps.commit_title.outputs.title }}coder_session_token:${{ secrets.CODER_SESSION_TOKEN }}
  2. Update a Coder template with a random version name without activating.

    name:Update Coder Templateon:push:branches:      -mainjobs:update:runs-on:ubuntu-lateststeps:      -name:Checkoutuses:actions/checkout@v4      -name:Update Coder Templateuses:matifali/update-coder-template@v3with:id:my-templatedir:my-templateurl:https://coder.example.comactivate:falsecoder_session_token:${{ secrets.CODER_SESSION_TOKEN }}

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp