{"id":13602892,"url":"https://github.com/asyncapi-archived-repos/github-action-for-cli","last_synced_at":"2025-04-11T13:31:38.800Z","repository":{"id":37905918,"uuid":"250257208","full_name":"asyncapi-archived-repos/github-action-for-cli","owner":"asyncapi-archived-repos","description":"GitHub Action with generator, validator, converter and others - all in one for your AsyncAPI documents with AsyncAPI CLI as backbone","archived":true,"fork":false,"pushed_at":"2025-01-22T08:30:51.000Z","size":63797,"stargazers_count":50,"open_issues_count":0,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-06T04:59:58.938Z","etag":null,"topics":["asyncapi","bash","docker","get-global-node-release-workflows","github-action","workflow"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asyncapi-archived-repos.png","metadata":{"funding":{"github":"asyncapi","patreon":null,"open_collective":"asyncapi","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null},"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-26T12:50:23.000Z","updated_at":"2025-03-20T08:41:22.000Z","dependencies_parsed_at":"2023-12-15T22:05:04.602Z","dependency_job_id":"36284d0c-b019-4775-ac8e-6b02bc1f0bb3","html_url":"https://github.com/asyncapi-archived-repos/github-action-for-cli","commit_stats":{"total_commits":356,"total_committers":12,"mean_commits":"29.666666666666668","dds":0.2275280898876404,"last_synced_commit":"7a1fb57429017caa5d8e83b0f33bbf00b466d514"},"previous_names":["asyncapi/github-action-for-cli","asyncapi/github-action-for-generator","asyncapi-archived-repos/github-action-for-cli"],"tags_count":96,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi-archived-repos%2Fgithub-action-for-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi-archived-repos%2Fgithub-action-for-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi-archived-repos%2Fgithub-action-for-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi-archived-repos%2Fgithub-action-for-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asyncapi-archived-repos","download_url":"https://codeload.github.com/asyncapi-archived-repos/github-action-for-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248289979,"owners_count":21078923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["asyncapi","bash","docker","get-global-node-release-workflows","github-action","workflow"],"created_at":"2024-08-01T18:01:41.801Z","updated_at":"2025-04-11T13:31:38.790Z","avatar_url":"https://github.com/asyncapi-archived-repos.png","language":"Shell","funding_links":["https://github.com/sponsors/asyncapi","https://opencollective.com/asyncapi"],"categories":["workflow"],"sub_categories":[],"readme":"# GitHub Action for CLI\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n## Deprecation Notice\n\u003e [!IMPORTANT]\n\u003e This repository has been **deprecated**. The GitHub Action has been migrated to a new repository for better support and enhancements.\n\u003e ### Migration Details\n\u003e - The new repository: [asyncapi/cli](https://github.com/asyncapi/cli)  \n\u003e - Marketplace URL: [AsyncAPI CLI Action](https://github.com/marketplace/actions/asyncapi-cli-action)\n\u003e ### What to Update:\n\u003e - If you are using `asyncapi/github-action-for-cli` in your workflows, update it to `asyncapi/cli`.\n\u003e - Docker-based actions require no changes, but versions are now synced with CLI releases. Refer to [Docker Hub](https://hub.docker.com/r/asyncapi/github-action-for-cli) for details.\n\u003e ### Example Migration\n\u003e #### Old Workflow:\n\u003e ```yaml\n\u003e - name: AsyncAPI CLI Action\n\u003e  uses: asyncapi/github-action-for-cli@v2.0.0\n\u003e ```\n\u003e #### New Workflow:\n\u003e ```yaml\n\u003e - name: AsyncAPI CLI Action\n\u003e  uses: asyncapi/cli@v2.16.0\n\u003e```\n\u003e For further details, stay tuned for official documentation and blog posts explaining the changes and outlining best practices.\n\n---\n\nThis action exposes the [AsyncAPI CLI](https://github.com/asyncapi/cli). It allows you to generate documentation, validate AsyncAPI documents, convert between different AsyncAPI versions and much more.\n\n## Inputs\n\n### `cli_version`\n\nVersion of the AsyncAPI CLI you wish to use. You can find all available versions [here](https://github.com/asyncapi/cli/releases). Recommended leave it out of the inputs and use the default value.\n\n**Default** points to the`latest` version.\n\n\u003e [!TIP]\n\u003e We recommend to default to `latest` version. This way there is no overhead with the script updating the CLI version. As it takes a lot of time to update the CLI version, we recommend to update it only when you need to use another one for compatibility reasons.\n\n### `command`\n\nCommand that you wish to run. You can find all available commands Available commands are:\n- `generate` - generates documentation from AsyncAPI document\n- `validate` - validates AsyncAPI document\n- `optimize` - optimizes AsyncAPI document\n- `convert` - converts AsyncAPI document to another version\n- `custom` - allows you to run any command that is available in the AsyncAPI CLI. You can find all available commands [here](https://www.asyncapi.com/docs/tools/cli/usage).\n\n**Default** points to `generate` command.\n\n\u003e [!IMPORTANT]\n\u003e In case you want to use `custom` command, you need to pass an array of commands to the [`custom_command`](#custom_command) input. Although passing command is not required, it is recommended to pass it to avoid any issues later on.\n\u003e For example, if you want to run `asyncapi bundle ./asyncapi.yaml --output final-asyncapi.yaml` you need to pass `\"bundle ./asyncapi.yaml --output final-asyncapi.yaml\" to the `custom_command` input.\n\n### `custom_command`\n\nIn case you want to use `custom` command you need to pass the command that you want to run in this input. You can find all available commands [here](https://www.asyncapi.com/docs/tools/cli/usage). \n\n**Default** points to '' (empty string).\n\nSample usage:\n\n```yaml\n- name: Generating HTML from my AsyncAPI document\n  uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want\n  with:\n    custom_command: bundle ./asyncapi.yaml --output final-asyncapi.yaml\n```\n\n\u003e [!CAUTION]\n\u003e You have to pass the whole command as a string including the parameters and the command itself.\n\u003e It will run like this: `asyncapi \u003ccustom_command\u003e`\n\n\n### `filepath`\n\nPath to the AsyncAPI document that you want to process.   \n\n**Default** expects the AsyncAPI document to be in the root of the repository and named `asyncapi.yaml`.\n\n### `template`\n\nTemplate for the generator. Official templates are listed here https://github.com/asyncapi/generator#list-of-official-generator-templates. You can pass template as npm package, url to git repository, link to tar file or local template.\n\n**Default** points to `@asyncapi/markdown-template@0.10.0` template.\n\n\u003e [!TIP]\n\u003e We recommend to always specify the version of the template to not encounter any issues with the action in case of release of the template that is not compatible with given version of the generator.\n\n### `language`\n\nSpecifies the language to be used for the generated models. The value must be a valid language name supported by [modelina](https://github.com/asyncapi/modelina). \n\n**Default** is not set.\n\n\u003e [!WARNING]\n\u003e Either `language` or `template` must be set else an error will be thrown. \n\u003e The action will return an error if the language is not supported by [modelina](https://github.com/asyncapi/modelina).\n\n### `output`\n\nPath to the output directory. Can be used for `generate` and `convert` commands.\n\n**Default** points to `output` directory in the root of the repository.\n\n### `parameters`\n\nThe command that you use might support and even require specific parameters to be passed to the CLI for the generation. You can find all available parameters [here](https://www.asyncapi.com/docs/tools/cli/usage).\n\n**Default** points to '' (empty string).\n\n\u003e [!NOTE]\n\u003e For template parameters, you need to pass them as `-p \u003ctemplate_parameters\u003e` as can be seen in CLI documentation.\n\n\n## Example usage\n\n\u003e [!WARNING]\n\u003e Using `docker://asyncapi/github-action-for-cli` will not work as expected. This is because the GitHub Actions runner does not pass params to the docker image correctly. This is why we recommend to use `asyncapi/github-action-for-cli` instead.\n\u003e However, you don't need to worry as it won't build the image every time. It will pull it from Docker Hub as it is already built there.\n\n### Basic\n\nIn case all defaults are fine for you, just add such step:\n\n```yaml\n- name: Generating Markdown from my AsyncAPI document\n  uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want\n```\n\n### Using all possible inputs\n\nIn case you do not want to use defaults, you for example want to use different template:\n\n```yaml\n- name: Generating HTML from my AsyncAPI document\n  uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want\n  with:\n    command: generate\n    filepath: ./docs/api/asyncapi.yaml\n    template: \"@asyncapi/html-template@0.9.0\" #In case of template from npm. Or can use a link.\n    output: ./generated-html\n    parameters: \"-p baseHref=/test-experiment/ sidebarOrganization=byTags\"\n```\n\u003e [!IMPORTANT]\n\u003e Note the usage of `-p` in `parameters` input. This is required for template parameters, unlike previous versions of this action as the action includes other commands than just `generate`.\n\n### Example workflow with publishing generated HTML to GitHub Pages\n\nIn case you want to validate your asyncapi file first, and also send generated HTML to GitHub Pages this is how full workflow could look like:\n\n```yaml\nname: AsyncAPI documents processing\n\non:\n  push:\n    branches: [ master ]\n\njobs:\n  generate:\n    runs-on: ubuntu-latest\n    steps:\n    #\"standard step\" where repo needs to be checked-out first\n    - name: Checkout repo\n      uses: actions/checkout@v2\n      \n    #In case you do not want to use defaults, you for example want to use different template\n    - name: Generating HTML from my AsyncAPI document\n      uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want\n      with:\n        template: '@asyncapi/html-template@0.9.0'  #In case of template from npm, because of @ it must be in quotes\n        filepath: docs/api/my-asyncapi.yml\n        parameters: -p baseHref=/test-experiment/ sidebarOrganization=byTags #space separated list of key/values\n        output: generated-html\n      \n    #Using another action that takes generated HTML and pushes it to GH Pages\n    - name: Deploy GH page\n      uses: JamesIves/github-pages-deploy-action@3.4.2\n      with:\n        ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        BRANCH: gh-pages\n        FOLDER: generated-html\n```\n\n### Example workflow for generating models\n\nIn case you want to use models generated from your AsyncAPI document, you can use this action to generate them and then use them in your workflow. This is how full workflow could look like:\n\n```yaml\n\nname: AsyncAPI documents processing\n\non:\n  push:\n    branches: [ master ]\n\njobs:\n  generate-models:\n    runs-on: ubuntu-latest\n    steps:\n    #\"standard step\" where repo needs to be checked-out first\n    - name: Checkout repo\n      uses: actions/checkout@v2\n      \n    - name: Generating models from my AsyncAPI document\n      uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want\n      with:\n        command: generate\n        filepath: docs/api/my-asyncapi.yml\n        language: typescript\n        output: generated-models\n```\n\n### Example workflow for validating AsyncAPI document changes\n\nIn case you want to validate your AsyncAPI document changes, you can use this action to validate them and then use them in your workflow. This is how full workflow could look like:\n\n```yaml\nname: Validate AsyncAPI document\n\non:\n  pull_request:\n    branches: [ master ]\n\njobs:\n  validate:\n    runs-on: ubuntu-latest\n    steps:\n    #\"standard step\" where repo needs to be checked-out first\n    - name: Checkout repo\n      uses: actions/checkout@v2\n      \n    - name: Validating AsyncAPI document\n      uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want\n      with:\n        command: validate\n        filepath: docs/api/my-asyncapi.yml\n```\n\n## Troubleshooting\n\nYou can enable more log information in GitHub Action by adding `ACTIONS_STEP_DEBUG` secret to repository where you want to use this action. Set the value of this secret to `true` and you''ll notice more debug logs from this action.\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://www.brainfart.dev/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/6995927?v=4?s=100\" width=\"100px;\" alt=\"Lukasz Gornicki\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLukasz Gornicki\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/asyncapi/github-action-for-cli/commits?author=derberg\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#maintenance-derberg\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#infra-derberg\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/asyncapi/github-action-for-cli/pulls?q=is%3Apr+reviewed-by%3Aderberg\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/magicmatatjahu\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/20404945?v=4?s=100\" width=\"100px;\" alt=\"Maciej Urbańczyk\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMaciej Urbańczyk\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/asyncapi/github-action-for-cli/pulls?q=is%3Apr+reviewed-by%3Amagicmatatjahu\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://www.victormartingarcia.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/659832?v=4?s=100\" width=\"100px;\" alt=\"Victor\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVictor\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/asyncapi/github-action-for-cli/commits?author=victormartingarcia\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/HUTCHHUTCHHUTCH\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/55915170?v=4?s=100\" width=\"100px;\" alt=\"HUTCHHUTCHHUTCH\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHUTCHHUTCHHUTCH\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-HUTCHHUTCHHUTCH\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/pioneer2k\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/32297829?v=4?s=100\" width=\"100px;\" alt=\"Thomas Heyer\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eThomas Heyer\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-pioneer2k\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://ashishpadhy.live\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/100484401?v=4?s=100\" width=\"100px;\" alt=\"Ashish Padhy\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAshish Padhy\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/asyncapi/github-action-for-cli/commits?author=Shurtu-gal\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/asyncapi/github-action-for-cli/commits?author=Shurtu-gal\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/asyncapi/github-action-for-cli/commits?author=Shurtu-gal\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#ideas-Shurtu-gal\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasyncapi-archived-repos%2Fgithub-action-for-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasyncapi-archived-repos%2Fgithub-action-for-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasyncapi-archived-repos%2Fgithub-action-for-cli/lists"}