From 6549e6afa3c63200937e676aa5254a68cda0f4c4 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 5 Sep 2023 12:42:55 +0300 Subject: [PATCH 01/12] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7737f84..ed9afea 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,11 @@ Update coder templates automatically - 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 }}" + 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 }} ``` @@ -84,9 +84,9 @@ Update coder templates automatically - name: Update Coder Template uses: matifali/update-coder-template@v3 with: - id: "my-template" - dir: "my-template" - url: "https://coder.example.com" - activate: "false" + id: my-template + dir: my-template + url: https://coder.example.com + activate: false coder_session_token: ${{ secrets.CODER_SESSION_TOKEN }} ``` From e817d90ef0ff1c5c15fc711bea2b823310165d63 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 5 Sep 2023 13:03:47 +0300 Subject: [PATCH 02/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed9afea..5bc07b9 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Update coder templates automatically 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 + run: echo "title=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT - name: Update Coder Template From 5a254fcb9691a84a11b55de9f42e31a25121e8ee Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 14 Nov 2023 13:11:27 +0300 Subject: [PATCH 03/12] Merge pull request #5 from matifali/v3 (#6) update README.md --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7737f84..5bc07b9 100644 --- a/README.md +++ b/README.md @@ -50,17 +50,17 @@ Update coder templates automatically 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 + run: echo "title=$(git log -1 --pretty=%s)" >> $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 }}" + 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 }} ``` @@ -84,9 +84,9 @@ Update coder templates automatically - name: Update Coder Template uses: matifali/update-coder-template@v3 with: - id: "my-template" - dir: "my-template" - url: "https://coder.example.com" - activate: "false" + id: my-template + dir: my-template + url: https://coder.example.com + activate: false coder_session_token: ${{ secrets.CODER_SESSION_TOKEN }} ``` From cf7688dc74b96d4b7fb01634b7705ab3af5c3b97 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 11 Jan 2024 21:16:34 +0300 Subject: [PATCH 04/12] fix: remove create flag --- push_template.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/push_template.sh b/push_template.sh index e209ff2..b737481 100755 --- a/push_template.sh +++ b/push_template.sh @@ -19,11 +19,6 @@ if [ -n "${CODER_TEMPLATE_MESSAGE}" ]; then push_command+=" --message \"${CODER_TEMPLATE_MESSAGE}\"" fi -# Append --create flag to the push command if CODER_TEMPLATE_CREATE is true -if [ "${CODER_TEMPLATE_CREATE}" = "true" ]; then - push_command+=" --create" -fi - # Add version to the push command if specified if [ -n "${CODER_TEMPLATE_VERSION_NAME}" ]; then push_command+=" --name ${CODER_TEMPLATE_VERSION_NAME}" From 41bdcde5237f6210d5d7cf8e34718eb62f7699b6 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 11 Jan 2024 21:17:22 +0300 Subject: [PATCH 05/12] Update action.yaml --- action.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/action.yaml b/action.yaml index 1c0448b..2fd9a9b 100644 --- a/action.yaml +++ b/action.yaml @@ -1,6 +1,6 @@ name: Update Coder Template description: An action to deploy changes to your coder template automatically -author: "Muhammad Atif Ali " +author: "Muhammad Atif Ali " branding: icon: arrow-up-circle @@ -30,10 +30,6 @@ inputs: description: "update message" required: false default: "Updated via update-coder-template action" - create: - description: "Creates a new template if it does not exist" - required: false - default: "true" dry_run: description: "Dry run" required: false @@ -57,5 +53,4 @@ runs: CODER_TEMPLATE_VERSION_NAME: ${{ inputs.name }} CODER_TEMPLATE_ACTIVATE: ${{ inputs.activate }} CODER_TEMPLATE_MESSAGE: ${{ inputs.message }} - CODER_TEMPLATE_CREATE: ${{ inputs.create }} CODER_TEMPLATE_DRY_RUN: ${{ inputs.dry_run }} From d3f671814f543ea09489ea06e083b92d44b57fee Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 11 Jan 2024 21:18:08 +0300 Subject: [PATCH 06/12] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 5bc07b9..3cbed6b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ Update coder templates automatically | **`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` | From 3dd8fbfabaf60c8c5e6bbf9bfa87aee1e5127fca Mon Sep 17 00:00:00 2001 From: Muhammad Danish Date: Sun, 25 Feb 2024 17:19:25 +0500 Subject: [PATCH 07/12] Update description for ID field --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3cbed6b..ef29632 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,17 @@ Update coder templates automatically ## Inputs -| Name | Description | Default | -| ------------------------- | ------------------------------------------------------------------------ | --------------------------- | -| **`url`** | **Required** The url of coder deployment (e.g. ). | - | -| **`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` | -| `message` | Update message (similar to commit messages) | - | -| `dry_run` | Dry run mode. | `false` | +| Name | Description | Default | +|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------| +| **`url`** | **Required** The url of coder deployment (e.g. ). | - | +| **`coder_session_token`** | **Required** The session token of coder. | - | +| **`id`** | **Required** The name of the template. This can be seen under Templates > Your Template > Settings > General info in the coder deployment. | - | +| **`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` | +| `message` | Update message (similar to commit messages) | - | +| `dry_run` | Dry run mode. | `false` | + ## Examples From f14c3eb417efd5deae522e523d70be607b35f42b Mon Sep 17 00:00:00 2001 From: Muhammad Danish Date: Sun, 25 Feb 2024 17:21:14 +0500 Subject: [PATCH 08/12] shorten table --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ef29632..272befa 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,17 @@ Update coder templates automatically ## Inputs -| Name | Description | Default | -|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------| -| **`url`** | **Required** The url of coder deployment (e.g. ). | - | -| **`coder_session_token`** | **Required** The session token of coder. | - | -| **`id`** | **Required** The name of the template. This can be seen under Templates > Your Template > Settings > General info in the coder deployment. | - | -| **`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` | -| `message` | Update message (similar to commit messages) | - | -| `dry_run` | Dry run mode. | `false` | +| Name | Description | Default | +|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------| +| **`url`** | **Required** The url of coder deployment (e.g. ). | - | +| **`coder_session_token`** | **Required** The session token of coder. | - | +| **`id`** | **Required** The name of the template. Visible under Templates > Your Template > Settings > General info in the coder deployment. | - | +| **`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` | +| `message` | Update message (similar to commit messages) | - | +| `dry_run` | Dry run mode. | `false` | + ## Examples From a98e206dcdf9d4d2dd4554d47565626a5ffd439e Mon Sep 17 00:00:00 2001 From: Muhammad Danish Date: Sun, 25 Feb 2024 17:24:04 +0500 Subject: [PATCH 09/12] shorten more for better plaintext --- README.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 272befa..24dd747 100644 --- a/README.md +++ b/README.md @@ -15,18 +15,16 @@ Update coder templates automatically ## Inputs -| Name | Description | Default | -|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------| -| **`url`** | **Required** The url of coder deployment (e.g. ). | - | -| **`coder_session_token`** | **Required** The session token of coder. | - | -| **`id`** | **Required** The name of the template. Visible under Templates > Your Template > Settings > General info in the coder deployment. | - | -| **`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` | -| `message` | Update message (similar to commit messages) | - | -| `dry_run` | Dry run mode. | `false` | - - +| Name | Description | Default | +|---------------------------|----------------------------------------------------------------------------------------------------------------|-----------------------------| +| **`url`** | **Required** The url of coder deployment (e.g. ). | - | +| **`coder_session_token`** | **Required** The session token of coder. | - | +| **`id`** | **Required** The name of the template. Visible under Template Settings > General info in the coder deployment. | - | +| **`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` | +| `message` | Update message (similar to commit messages) | - | +| `dry_run` | Dry run mode. | `false` | ## Examples From 2909d6cadca162e0be010b6966e587eec833202f Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 23 May 2024 12:02:21 +0300 Subject: [PATCH 10/12] Create update-main-version --- .github/workflows/update-main-version | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/update-main-version diff --git a/.github/workflows/update-main-version b/.github/workflows/update-main-version new file mode 100644 index 0000000..a589784 --- /dev/null +++ b/.github/workflows/update-main-version @@ -0,0 +1,30 @@ +name: Update Main Version +run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }} + +on: + workflow_dispatch: + inputs: + target: + description: The tag or reference to use + required: true + major_version: + type: choice + description: The major version to update + options: + - v3 + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Git config + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Tag new target + run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }} + - name: Push new tag + run: git push origin ${{ github.event.inputs.major_version }} --force From c468103ff63b5f580412306c550a766f6bad440e Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 23 May 2024 12:04:42 +0300 Subject: [PATCH 11/12] Delete .github/workflows/release.yaml We are moving to manual releases. --- .github/workflows/release.yaml | 38 ---------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index e90b539..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Release - -on: - push: - tags: - - "v*" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - # check if tag name has alpha or beta - - name: Check if tag name has alpha or beta - id: check_tag_name - run: | - set -euo pipefail - if [[ "${{ github.ref }}" =~ -(alpha|beta)- ]]; then - echo "PRE_RELEASE=true" >> $GITHUB_OUTPUT - else - echo "PRE_RELEASE=false" >> $GITHUB_OUTPUT - fi - - # Create a pre release if tag name has alpha or beta - - name: Create pre release - if: steps.check_tag_name.outputs.PRE_RELEASE == 'true' - run: gh release create ${{ github.ref }} -t ${{ github.ref_name }} --prerelease --generate-notes -R ${{ github.repository }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # Create release - - name: Create release - if: steps.check_tag_name.outputs.PRE_RELEASE == 'false' - run: gh release create ${{ github.ref }} -t ${{ github.ref_name }} --generate-notes -R ${{ github.repository }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ccc49c4662ffa92ace4f63fdd55684663c1f46f6 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 23 May 2024 12:06:59 +0300 Subject: [PATCH 12/12] Rename update-main-version to update-main-version.yaml --- .../workflows/{update-main-version => update-main-version.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{update-main-version => update-main-version.yaml} (100%) diff --git a/.github/workflows/update-main-version b/.github/workflows/update-main-version.yaml similarity index 100% rename from .github/workflows/update-main-version rename to .github/workflows/update-main-version.yaml