diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4ae2a1..52030b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,14 +10,22 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Run structurizr-cli action + - name: Run structurizr-cli command [Push] uses: ./ - id: test + id: push with: - id: ${{ secrets.STZR_ID }} + command: push + workspace_id: ${{ secrets.STZR_ID }} + key: ${{ secrets.STZR_API_KEY }} + secret: ${{ secrets.STZR_API_SECRET }} + workspace_file_param: -workspace + workspace_file: ./tests/workspace.dsl + + - name: Run structurizr-cli command [Pull] + uses: ./ + id: pull + with: + command: pull + workspace_id: ${{ secrets.STZR_ID }} key: ${{ secrets.STZR_API_KEY }} secret: ${{ secrets.STZR_API_SECRET }} - workspace: ./tests/workspace.dsl - url: https://api.structurizr.com - merge: false - archive: false 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) diff --git a/action.yml b/action.yml index 23ebc0d..66fbf7e 100644 --- a/action.yml +++ b/action.yml @@ -5,55 +5,28 @@ 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 - docs: - description: 'The path to the directory containing Markdown/AsciiDoc files to be published (optional)' - required: false - adrs: - description: 'The path to the directory containing ADRs (optional)' - required: false - 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 - archive: - description: 'Whether to store the previous version of the remote workspace (optional; default to true)' - required: false + description: 'The workspace API secret' + workspace_file_param: + description: Static parameter + 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' + image: 'docker://structurizr/cli:latest' args: - - 'push' - - '-id' - - ${{ inputs.id }} - - '-key' - - ${{ inputs.key }} - - '-secret' - - ${{ inputs.secret }} - - '-workspace' - - ${{ inputs.workspace }} - - '-url' - - ${{ inputs.url }} - - '-passphrase' - - ${{ inputs.passphrase }} - - '-merge' - - ${{ inputs.merge }} - - '-archive' - - ${{ inputs.archive }} + - ${{ inputs.command }} + - '-id' + - ${{ inputs.workspace_id }} + - '-key' + - ${{ inputs.key }} + - '-secret' + - ${{ inputs.secret }} + - ${{ inputs.workspace_file_param }} + - ${{ inputs.workspace_file }} 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."