8000 first commit · coder/setup-action@54e2cb0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 54e2cb0

Browse files
committed
first commit
0 parents  commit 54e2cb0

File tree

4 files changed

+118
-0
lines changed

4 files changed

+118
-0
lines changed

.github/workflows/release.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: release
2+
run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}
3+
4+
# This workflow is triggered manually by the user to tag a new version
5+
# It will move the major version tag to the new target tag
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
target:
11+
description: The tag or reference to use
12+
required: true
13+
major_version:
14+
type: choice
15+
description: The major version to update
16+
options:
17+
- v1
18+
19+
jobs:
20+
tag:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Git config
27+
run: |
28+
git config user.name "cdrci"
29+
git config user.email "78873720+cdrci@users.noreply.github.com"
30+
- name: Tag new target
31+
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}
32+
- name: Push new tag
33+
run: git push origin ${{ github.event.inputs.major_version }} --force

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Coder Technologies Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Setup [Coder](https://github.com/coder/coder)
2+
3+
Downloads and Configures Coder.
4+
5+
## Usage
6+
7+
Create a GitHub secret named `CODER_SESSION_TOKEN` with your coder session token
8+
You can generate a long lived session token by running the following command in
9+
your browser console while logged into Coder with a **Template Admin** or
10+
**Owner** role.
11+
12+
```shell
13+
coder token create --lifetime 8760h --name "GitHub Actions"
14+
```
15+
16+
```yaml
17+
jobs:
18+
setup-coder:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Setup Coder
22+
uses: coder/setup-coder@v1
23+
with:
24+
access_url: 'https://dev.coder.com'
25+
coder_session_token: ${{ secrets.CODER_SESSION_TOKEN }}
26+
```
27+
28+
## Inputs
29+
30+
| Name | Description | Default |
31+
| ------------------------- | ------------------------------------------------------------------------ | ------- |
32+
| **`access_url`** | **Required** The url of coder deployment (e.g. <https://dev.coder.com>). | - |
33+
| **`coder_session_token`** | **Required** The session token of coder. | - |

action.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Setup Coder
2+
description: An action to setup and configure Coder.
3+
author: "Coder Technologies Inc. <https://coder.com>"
4+
5+
branding:
6+
icon: arrow-down-circle
7+
color: purple
8+
9+
inputs:
10+
access_url:
11+
description: "Coder access URL (e.g. https://coder.example.com)"
12+
required: true
13+
coder_session_token:
14+
description: "Coder session token"
15+
required: true
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Download Coder binary from access URL
21+
run: curl -fsSL $CODER_URL/bin/coder-linux-amd64 -o /usr/local/bin/coder && chmod +x /usr/local/bin/coder
22+
shell: bash
23+
env:
24+
CODER_URL: ${{ inputs.access_url }}
25+
26+
- name: Login to Coder
27+
run: coder login --token $CODER_SESSION_TOKEN $CODER_URL
28+
shell: bash
29+
env:
30+
CODER_URL: ${{ inputs.access_url }}
31+
CODER_SESSION_TOKEN: ${{ inputs.coder_session_token }}

0 commit comments

Comments
 (0)
0