{"id":28972528,"url":"https://github.com/hackolade/studio-cli-github-actions-examples","last_synced_at":"2026-01-20T16:27:15.512Z","repository":{"id":297016898,"uuid":"995338555","full_name":"hackolade/studio-cli-github-actions-examples","owner":"hackolade","description":"GitHub Action's workflow examples to leverage Hackolade Studio CLI Docker image for CI/CD use cases","archived":false,"fork":false,"pushed_at":"2025-06-06T13:20:47.000Z","size":249,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-26T01:23:12.209Z","etag":null,"topics":["cli","command-line-interface","data-modeling","docker"],"latest_commit_sha":null,"homepage":"https://hackolade.com","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackolade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-03T10:29:13.000Z","updated_at":"2025-06-06T13:20:48.000Z","dependencies_parsed_at":"2025-06-03T22:27:09.880Z","dependency_job_id":"5e822571-afc8-457e-9813-b09144b5d0d8","html_url":"https://github.com/hackolade/studio-cli-github-actions-examples","commit_stats":null,"previous_names":["hackolade/studio-cli-github-actions-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hackolade/studio-cli-github-actions-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fstudio-cli-github-actions-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fstudio-cli-github-actions-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fstudio-cli-github-actions-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fstudio-cli-github-actions-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackolade","download_url":"https://codeload.github.com/hackolade/studio-cli-github-actions-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fstudio-cli-github-actions-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line-interface","data-modeling","docker"],"created_at":"2025-06-24T11:06:46.637Z","updated_at":"2026-01-20T16:27:15.497Z","avatar_url":"https://github.com/hackolade.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Run Hackolade CLI using Docker Compose on GitHub Actions](https://gitHub.com/hackolade/studio-cli-gitHub-actions-examples/actions/workflows/generate-doc-and-jsonschema.yml/badge.svg)](https://gitHub.com/hackolade/studio-cli-gitHub-actions-examples/actions/workflows/generate-doc-and-jsonschema.yml)\n\n# GitHub Actions workflow example of running Hackolade Studio CLI\nFor CI/CD scenarios leveraging the Docker image of Hackolade Studio CLI [documented here](https://gitHub.com/hackolade/docker/tree/main/Studio#readme), you may want to leverage the GitHub Actions workflow.  This repository is just a simple example.  It should serve as an inspiration for users.  It is possible to orchestrate a succession of Hackolade Studio CLI commands, combined with Git commands and others to achieve ambitious use cases, all triggered by events in your repository.  For example when a PR for a model is merged in to the main branch.\n\n\u003e[!IMPORTANT]\n\u003eThe workflows examples are meant to serve as inspiration.\n\u003e You must review each GitHub Action your are using eventually and make sure it complies with your organization security policies and constraints, as well as check potential CVEs that could affect such actions.\n\n## Licensing\n\n\u003e [!TIP]\n\u003eRunning Hackolade Studio Docker image on GitHub Actions requires a concurrent License.\n\u003eTo purchase a concurrent license subscription, please send an email to sales@hackolade.com.\n\nThis repository exposes a workflow example that uses a license managed as a [GitHub Actions secret](https://docs.gitHub.com/en/actions/security-for-gitHub-actions/security-guides/using-secrets-in-gitHub-actions). License keys should be kept secret.\n\n## Build your Docker image and push it to Docker Hub\n\nThe [Dockerfile](./Dockerfile) contained in this repository allows to build an image with the latest release of Hackolade Studio available at the time of build, using the Docker image [hackolade/studio](https://hub.docker.com/r/hackolade/studio/)\n\n\u003e [!TIP]\n\u003eIn order to significantly save bandwidth, it is advised to build the image and push your image to Docker Hub or your own private Container registry of choice.\n\nIn the example we  have the image ***studio:latest*** hosted on Docker Hub with the plugins we want to use.\n\n```bash\ndocker buildx build -t studio:latest --push .\n```\n\n\u003e [!NOTE]\n\u003eMake sure your compose file is aligned.\n\n\n\n## Generating documentation with a [Docker image built locally](./Dockerfile) and a [compose file](./compose.yml)\n\nTo illustrate how to use the Hackolade Studio CLI in GitHub Actions, this repository contains [one workflow file](./.gitHub/workflows/generate-doc-and-jsonschema.yml).\n\nIt uses an example Couchbase model ***travel.json*** contained in this repository.\n\n\u003e [!NOTE]\n\u003eThis workflow example uses a manual trigger (e.g. uses workflow_dispatch GHA trigger event).  See below for a trigger example.\n\nThe workflow file executes the following steps:\n\n1. Validate a concurrent license key (managed as a repository secret)\n2. Generate Markdown documentation for the example travel.json model, followed by the forward-engineering of JSON Schema  files for each of the entities in the model\n4. Gather logs and generated artifacts into GitHub workspace on the runner\n5. Open a Pull Request from these artifacts\n\n\n\nThe workflow and the compose files are aligned and use the following default variables:\n\n- ***HACKOLADE_STUDIO_CLI_IMAGE*** defaulting to `studio:latest` -\u003e the Docker image name for Hackolade Studio CLI.\n- ***REPOSITORY_DIR_IN_CONTAINER*** defaulting to `/gitHub/workspace/repository` -\u003e the working directory for the CLI and where the GitHub repository content is mounted.\n- ***OUTPUT_DIR_IN_CONTAINER*** defaulting to `/home/hackolade/Documents/output` -\u003e where artifacts are generated by the CLI.\n\n\n\n## Common scenario: Trigger the workflow when a Pull Request is merged in to the main branch.\n\n\u003eA data modeler pushes a Pull Request with updates to a model made using Hackolade Studio Workgroup Edition.\n\nIn this scenario, we would like to automatically generate the new Markdown documentation for this updated model when the Pull Request is being merged into the `main` branch\n\nHere is a workflow trigger example for this use case:\n\n```yaml\nname: Run Hackolade CLI using Docker Compose on GitHub Actions\non:\n    push:\n        branches:\n            - main\njobs:\n run-hackolade-with-compose:\n    runs-on: ubuntu-latest\n    env:\n        # License key must be managed as a secret (Repository or Organization)\n        HACKOLADE_KEY: ${{ secrets.HACKOLADE_CONCURRENT_LICENSE_KEY }}\n        HACKOLADE_STUDIO_CLI_IMAGE: studio:latest\n        REPOSITORY_DIR_IN_CONTAINER: '/gitHub/workspace/repository'\n        OUTPUT_DIR_IN_CONTAINER: '/home/hackolade/Documents/output'\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0  # OR \"2\" -\u003e To retrieve the preceding commit.\n\n      #https://gitHub.com/tj-actions/changed-files?tab=readme-ov-file#on-push-%EF%B8%8F\n      - name: Get changed files\n        id: changed-files\n        uses: step-security/changed-files@46.0.5\n        files: '**/*.hck.json'\n\n      # - ... validate license (check workflow example)\n\n      - name: Generate MD documentation for all changed models\n        env:\n          ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}\n        run: |\n          for modelFile in ${ALL_CHANGED_FILES}; do\n            modelFilenameWithoutExt=$(echo \"${modelFile%.*}\")\n            docker compose run --rm hackoladeStudioCLI genDoc \\\n            --model=${modelFile} \\\n            --format=MD \\\n            --doc=${{ env.OUTPUT_DIR_IN_CONTAINER }}/${modelFilenameWithoutExt}.md\n          done\n        ...\n\n```\n\n## Persist logs for troubleshooting when help from Hackolade Support is necessary\n\nHackolade Studio Cli is persisting its logs inside each Docker container that is created when executing Studio CLI commands.  To make sure you gather these logs for each step of your workflow you need to:\n\n1. Extract these logs from the container into a local.\n  \u003eThis is done in the example workflow thanks to a data container serving as a proxy to Docker named volumes.\n  \u003eYou can then use this container ***hck-studio-cli-generated-data*** to retrieve the data you need into a local folder (e.g. `./logs`) on the GitHub Action runner.\n\nExample:\n```yaml\n      - name: Retrieve Hackolade logs from volumes\n        run: |\n          docker cp ${{ env.DATA_VOLUMES_CONTAINER_NAME }}:/logs/. ${PWD}/logs/logs-fe-jsonschema-generation\n\n```\n\n2. Upload all the files you want to keep to GitHub Artifacts.\n\u003eThis is done in the example workflow thanks to the action [actions/upload-artifact](#https://github.com/actions/upload-artifact/tree/v4/?tab=readme-ov-file#zip-archives).  This action makes sure you have a link to a Zip archive containing all your assets for each of your workflow run.\n\nExample:\n```yaml\n      - name: Upload logs to Github Artifacts\n        id: persist-logs\n        uses: actions/upload-artifact@v4.6.2\n        with:\n          name: studio-cli-logs\n          path: ./logs\n          if-no-files-found: warn\n          retention-days: 5\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackolade%2Fstudio-cli-github-actions-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackolade%2Fstudio-cli-github-actions-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackolade%2Fstudio-cli-github-actions-examples/lists"}