From 2bd2684d064542d084f18feb4b3209c1cb0b4a5e Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Fri, 23 Feb 2024 09:32:10 +0300 Subject: [PATCH 01/15] Make all args optional; Rename args --- .github/workflows/test.yml | 5 +++-- action.yml | 44 ++++++++++++-------------------------- 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4ae2a1..8f37850 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,11 @@ jobs: uses: ./ id: test with: - id: ${{ secrets.STZR_ID }} + command: push + workspace_id: ${{ secrets.STZR_ID }} key: ${{ secrets.STZR_API_KEY }} secret: ${{ secrets.STZR_API_SECRET }} - workspace: ./tests/workspace.dsl + workspace_file: ./tests/workspace.dsl url: https://api.structurizr.com merge: false archive: false diff --git a/action.yml b/action.yml index 23ebc0d..8cc3f86 100644 --- a/action.yml +++ b/action.yml @@ -5,55 +5,39 @@ branding: icon: 'copy' color: 'blue' inputs: - id: - description: 'The workspace ID (required)' - required: true + command: + description: 'Command' + workspace_id: + description: 'The workspace ID' key: - description: 'The workspace API key (required)' - required: true + description: 'The workspace API key' secret: - description: 'The workspace API secret (required)' - required: true - workspace: - description: 'The path to the workspace JSON file/DSL file(s) (required)' - required: true + description: 'The workspace API secret' + workspace_file: + description: 'The path to the workspace JSON file/DSL file(s)' docs: - description: 'The path to the directory containing Markdown/AsciiDoc files to be published (optional)' - required: false + description: 'The path to the directory containing Markdown/AsciiDoc files to be published' adrs: - description: 'The path to the directory containing ADRs (optional)' - required: false + description: 'The path to the directory containing ADRs' url: description: 'The Structurizr API URL (optional; defaults to https://api.structurizr.com)' - required: false default: 'https://api.structurizr.com' passphrase: description: 'The passphrase to use (optional; only required if client-side encryption enabled on the workspace)' - required: false merge: - description: 'Whether to merge layout information from the remote workspace (optional: defaults to true)' - required: false + description: 'Whether to merge layout information from the remote workspace' archive: description: 'Whether to store the previous version of the remote workspace (optional; default to true)' - required: false runs: using: 'docker' image: 'docker://ghcr.io/aidmax/structurizr-cli-docker:latest' args: - - 'push' - - '-id' - - ${{ inputs.id }} - - '-key' + - ${{ inputs.command }} + - ${{ inputs.workspace_id }} - ${{ inputs.key }} - - '-secret' - ${{ inputs.secret }} - - '-workspace' - - ${{ inputs.workspace }} - - '-url' + - ${{ inputs.workspace_file }} - ${{ inputs.url }} - - '-passphrase' - ${{ inputs.passphrase }} - - '-merge' - ${{ inputs.merge }} - - '-archive' - ${{ inputs.archive }} From c1589f9f0e93b3b9d21132b858021b188c6e6bcd Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Fri, 23 Feb 2024 09:37:05 +0300 Subject: [PATCH 02/15] Pass identifiers --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f37850..fa1396d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,13 +12,13 @@ jobs: - name: Run structurizr-cli action uses: ./ - id: test + id: push with: command: push - workspace_id: ${{ secrets.STZR_ID }} - key: ${{ secrets.STZR_API_KEY }} - secret: ${{ secrets.STZR_API_SECRET }} - workspace_file: ./tests/workspace.dsl - url: https://api.structurizr.com - merge: false - archive: false + workspace_id: '-id ${{ secrets.STZR_ID }}' + key: '-key ${{ secrets.STZR_API_KEY }}' + secret: '-secret ${{ secrets.STZR_API_SECRET }}' + workspace_file: '-workspace ./tests/workspace.dsl' + url: '-url https://api.structurizr.com' + merge: '-merge false' + archive: '-archive false' From b96516999395090932fe361eb5ac72d4fd85562c Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Fri, 23 Feb 2024 10:18:07 +0300 Subject: [PATCH 03/15] Make it non-string --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa1396d..80caac8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: id: push with: command: push - workspace_id: '-id ${{ secrets.STZR_ID }}' + workspace_id: -id ${{ secrets.STZR_ID }} key: '-key ${{ secrets.STZR_API_KEY }}' secret: '-secret ${{ secrets.STZR_API_SECRET }}' workspace_file: '-workspace ./tests/workspace.dsl' From 00c2e56a32547de551f8dec333f7e915eaead510 Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 05:54:50 +0300 Subject: [PATCH 04/15] Remove inputs altogether --- .github/workflows/test.yml | 15 ++++++++------- action.yml | 34 ---------------------------------- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80caac8..401b881 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,11 @@ jobs: id: push with: command: push - workspace_id: -id ${{ secrets.STZR_ID }} - key: '-key ${{ secrets.STZR_API_KEY }}' - secret: '-secret ${{ secrets.STZR_API_SECRET }}' - workspace_file: '-workspace ./tests/workspace.dsl' - url: '-url https://api.structurizr.com' - merge: '-merge false' - archive: '-archive false' + workspace_param: -id + workspace_id: ${{ secrets.STZR_ID }} + key_param: -key + key: ${{ secrets.STZR_API_KEY }} + secret_param: -secret + secret: ${{ secrets.STZR_API_SECRET }} + workspace_file_param: -workspace + workspace_file: ./tests/workspace.dsl diff --git a/action.yml b/action.yml index 8cc3f86..045a238 100644 --- a/action.yml +++ b/action.yml @@ -4,40 +4,6 @@ author: 'Maksim Milykh' branding: icon: 'copy' color: 'blue' -inputs: - command: - description: 'Command' - workspace_id: - description: 'The workspace ID' - key: - description: 'The workspace API key' - secret: - description: 'The workspace API secret' - workspace_file: - description: 'The path to the workspace JSON file/DSL file(s)' - docs: - description: 'The path to the directory containing Markdown/AsciiDoc files to be published' - adrs: - description: 'The path to the directory containing ADRs' - url: - description: 'The Structurizr API URL (optional; defaults to https://api.structurizr.com)' - default: 'https://api.structurizr.com' - passphrase: - description: 'The passphrase to use (optional; only required if client-side encryption enabled on the workspace)' - merge: - description: 'Whether to merge layout information from the remote workspace' - archive: - description: 'Whether to store the previous version of the remote workspace (optional; default to true)' runs: using: 'docker' image: 'docker://ghcr.io/aidmax/structurizr-cli-docker:latest' - args: - - ${{ inputs.command }} - - ${{ inputs.workspace_id }} - - ${{ inputs.key }} - - ${{ inputs.secret }} - - ${{ inputs.workspace_file }} - - ${{ inputs.url }} - - ${{ inputs.passphrase }} - - ${{ inputs.merge }} - - ${{ inputs.archive }} From bc945353dcf667a315da953157620a03107ab183 Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 06:19:28 +0300 Subject: [PATCH 05/15] Revert "Remove inputs altogether" This reverts commit 00c2e56a32547de551f8dec333f7e915eaead510. --- .github/workflows/test.yml | 15 +++++++-------- action.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 401b881..80caac8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,11 +15,10 @@ jobs: id: push with: command: push - workspace_param: -id - workspace_id: ${{ secrets.STZR_ID }} - key_param: -key - key: ${{ secrets.STZR_API_KEY }} - secret_param: -secret - secret: ${{ secrets.STZR_API_SECRET }} - workspace_file_param: -workspace - workspace_file: ./tests/workspace.dsl + workspace_id: -id ${{ secrets.STZR_ID }} + key: '-key ${{ secrets.STZR_API_KEY }}' + secret: '-secret ${{ secrets.STZR_API_SECRET }}' + workspace_file: '-workspace ./tests/workspace.dsl' + url: '-url https://api.structurizr.com' + merge: '-merge false' + archive: '-archive false' diff --git a/action.yml b/action.yml index 045a238..8cc3f86 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,40 @@ author: 'Maksim Milykh' branding: icon: 'copy' color: 'blue' +inputs: + command: + description: 'Command' + workspace_id: + description: 'The workspace ID' + key: + description: 'The workspace API key' + secret: + description: 'The workspace API secret' + workspace_file: + description: 'The path to the workspace JSON file/DSL file(s)' + docs: + description: 'The path to the directory containing Markdown/AsciiDoc files to be published' + adrs: + description: 'The path to the directory containing ADRs' + url: + description: 'The Structurizr API URL (optional; defaults to https://api.structurizr.com)' + default: 'https://api.structurizr.com' + passphrase: + description: 'The passphrase to use (optional; only required if client-side encryption enabled on the workspace)' + merge: + description: 'Whether to merge layout information from the remote workspace' + archive: + description: 'Whether to store the previous version of the remote workspace (optional; default to true)' runs: using: 'docker' image: 'docker://ghcr.io/aidmax/structurizr-cli-docker:latest' + args: + - ${{ inputs.command }} + - ${{ inputs.workspace_id }} + - ${{ inputs.key }} + - ${{ inputs.secret }} + - ${{ inputs.workspace_file }} + - ${{ inputs.url }} + - ${{ inputs.passphrase }} + - ${{ inputs.merge }} + - ${{ inputs.archive }} From 35d116a57bc0e854e2637ce3d47803e54122cbcd Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 06:26:39 +0300 Subject: [PATCH 06/15] Remove args --- .github/workflows/test.yml | 11 ++++------- action.yml | 35 ++++++++++++----------------------- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80caac8..10b3029 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,7 @@ jobs: id: push with: command: push - workspace_id: -id ${{ secrets.STZR_ID }} - key: '-key ${{ secrets.STZR_API_KEY }}' - secret: '-secret ${{ secrets.STZR_API_SECRET }}' - workspace_file: '-workspace ./tests/workspace.dsl' - url: '-url https://api.structurizr.com' - merge: '-merge false' - archive: '-archive false' + workspace_id: ${{ secrets.STZR_ID }} + key: ${{ secrets.STZR_API_KEY }} + secret: ${{ secrets.STZR_API_SECRET }} + workspace_file: ./tests/workspace.dsl diff --git a/action.yml b/action.yml index 8cc3f86..765fca7 100644 --- a/action.yml +++ b/action.yml @@ -7,37 +7,26 @@ branding: inputs: command: description: 'Command' + workspace_param: + description: Static parameter + default: -id workspace_id: description: 'The workspace ID' + key_param: + description: Static parameter + default: -key key: description: 'The workspace API key' + secret_param: + description: Static parameter + default: -secret secret: description: 'The workspace API secret' + workspace_file_param: + description: Static parameter + default: -workspace workspace_file: description: 'The path to the workspace JSON file/DSL file(s)' - docs: - description: 'The path to the directory containing Markdown/AsciiDoc files to be published' - adrs: - description: 'The path to the directory containing ADRs' - url: - description: 'The Structurizr API URL (optional; defaults to https://api.structurizr.com)' - default: 'https://api.structurizr.com' - passphrase: - description: 'The passphrase to use (optional; only required if client-side encryption enabled on the workspace)' - merge: - description: 'Whether to merge layout information from the remote workspace' - archive: - description: 'Whether to store the previous version of the remote workspace (optional; default to true)' runs: using: 'docker' image: 'docker://ghcr.io/aidmax/structurizr-cli-docker:latest' - args: - - ${{ inputs.command }} - - ${{ inputs.workspace_id }} - - ${{ inputs.key }} - - ${{ inputs.secret }} - - ${{ inputs.workspace_file }} - - ${{ inputs.url }} - - ${{ inputs.passphrase }} - - ${{ inputs.merge }} - - ${{ inputs.archive }} From 5bce1203fdf349fb673f62d3af3e242a946f41c3 Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:03:12 +0300 Subject: [PATCH 07/15] Remove static params except one --- .github/workflows/test.yml | 1 + action.yml | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10b3029..614b812 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,4 +18,5 @@ jobs: workspace_id: ${{ secrets.STZR_ID }} key: ${{ secrets.STZR_API_KEY }} secret: ${{ secrets.STZR_API_SECRET }} + workspace_file_param: -workspace workspace_file: ./tests/workspace.dsl diff --git a/action.yml b/action.yml index 765fca7..4912ad2 100644 --- a/action.yml +++ b/action.yml @@ -7,26 +7,27 @@ branding: inputs: command: description: 'Command' - workspace_param: - description: Static parameter - default: -id workspace_id: description: 'The workspace ID' - key_param: - description: Static parameter - default: -key key: description: 'The workspace API key' - secret_param: - description: Static parameter - default: -secret secret: description: 'The workspace API secret' workspace_file_param: description: Static parameter - default: -workspace + default: "" workspace_file: description: 'The path to the workspace JSON file/DSL file(s)' runs: using: 'docker' image: 'docker://ghcr.io/aidmax/structurizr-cli-docker:latest' + args: + - ${{ inputs.command }} + - '-id' + - ${{ inputs.id }} + - '-key' + - ${{ inputs.key }} + - '-secret' + - ${{ inputs.secret }} + - ${{ inputs.workspace_file_param }} + - ${{ inputs.workspace_file }} From 1c4a4c105aa31a6d8c41642a0889546a7a6b822f Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:05:28 +0300 Subject: [PATCH 08/15] Typo --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4912ad2..68a3273 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ runs: args: - ${{ inputs.command }} - '-id' - - ${{ inputs.id }} + - ${{ inputs.workspace_id }} - '-key' - ${{ inputs.key }} - '-secret' From b01fccd0ef28a01a88981cd79562f79e27b0d76e Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:08:06 +0300 Subject: [PATCH 09/15] Add scope --- tests/workspace.dsl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/workspace.dsl b/tests/workspace.dsl index 838dbf1..9bc593c 100644 --- a/tests/workspace.dsl +++ b/tests/workspace.dsl @@ -3,6 +3,10 @@ workspace "Getting Started" "This is a model of my software system." { !adrs doc/adr !docs doc/docs + configuration { + scope softwaresystem + } + model { user = person "User" "A user of my software system." softwareSystem = softwareSystem "Software System" "My software system." From 687254d05681cf5b6a5fee1dc4d3546aa66243ba Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:09:39 +0300 Subject: [PATCH 10/15] Add pull command --- .github/workflows/test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 614b812..b90de56 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,3 +20,12 @@ jobs: secret: ${{ secrets.STZR_API_SECRET }} workspace_file_param: -workspace workspace_file: ./tests/workspace.dsl + + - name: Run structurizr-cli action + uses: ./ + id: pull + with: + command: pull + workspace_id: ${{ secrets.STZR_ID }} + key: ${{ secrets.STZR_API_KEY }} + secret: ${{ secrets.STZR_API_SECRET }} From ce187d01d2f092439fa63501843e03813fa0bcb2 Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:12:01 +0300 Subject: [PATCH 11/15] Change action titles --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b90de56..103d926 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Run structurizr-cli action + - name: Run structurizr-cli action [Push] uses: ./ id: push with: @@ -21,7 +21,7 @@ jobs: workspace_file_param: -workspace workspace_file: ./tests/workspace.dsl - - name: Run structurizr-cli action + - name: Run structurizr-cli action [Pull] uses: ./ id: pull with: From b63913c3ca9ea6b3429df87d532b23545f7d94f4 Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:24:43 +0300 Subject: [PATCH 12/15] Switch to official docker container --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 68a3273..e0d7b6c 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: description: 'The path to the workspace JSON file/DSL file(s)' runs: using: 'docker' - image: 'docker://ghcr.io/aidmax/structurizr-cli-docker:latest' + image: 'docker://structurizr/cli:latest' args: - ${{ inputs.command }} - '-id' From e5c9e1babe30bbb1372ea0d41a4c9dd604e8f2b1 Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:27:35 +0300 Subject: [PATCH 13/15] Change action titles --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 103d926..52030b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Run structurizr-cli action [Push] + - name: Run structurizr-cli command [Push] uses: ./ id: push with: @@ -21,7 +21,7 @@ jobs: workspace_file_param: -workspace workspace_file: ./tests/workspace.dsl - - name: Run structurizr-cli action [Pull] + - name: Run structurizr-cli command [Pull] uses: ./ id: pull with: From 8631c14dca207be183c733999cde19e81cb610ab Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:32:00 +0300 Subject: [PATCH 14/15] Remove default for workspace parameter --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index e0d7b6c..66fbf7e 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,6 @@ inputs: description: 'The workspace API secret' workspace_file_param: description: Static parameter - default: "" workspace_file: description: 'The path to the workspace JSON file/DSL file(s)' runs: From 882ff6e3e3be29acd7535166a9b9122bbe0d5d85 Mon Sep 17 00:00:00 2001 From: Milykh_MV Date: Sun, 25 Feb 2024 07:42:18 +0300 Subject: [PATCH 15/15] Update docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5377283..48f19f4 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This GitHub action allows you to run [structurizr-cli](https://github.com/struct Currently, the action supports the following functionality: - __Push__ content to a Structurizr workspace (the cloud service or an on-premises installation) +- __Pull__ content from Structurizr (the cloud service or an on-premises installation) - A model and views defined using the [Structurizr DSL](https://github.com/structurizr/dsl) - Markdown/AsciiDoc documentation - Architecture Decision Records (ADRs)