Coder Social home page Coder Social logo

asyncapi / github-action-for-cli Goto Github PK

View Code? Open in Web Editor NEW
43.0 7.0 15.0 62.3 MB

GitHub Action with generator, validator, converter and others - all in one for your AsyncAPI documents with AsyncAPI CLI as backbone

License: Apache License 2.0

Dockerfile 5.63% Makefile 35.35% Shell 59.02%
asyncapi workflow github-action docker get-global-node-release-workflows bash

github-action-for-cli's Introduction

AsyncAPI Logo

Read the specification

The latest draft specification can be found at spec/asyncapi.md which tracks the latest commit to the master branch in this repository.

The human-readable markdown file is the source of truth for the specification.

Click to see reference links to older versions of the specification.

Looking for the JSON Schema files? Check out our spec-json-schemas repo.

Feel like contributing? Check out our contributor's guide.

Examples

Check out the examples directory for examples.

Case Studies and Adopters

Check out the AsyncAPI website to see the list of AsyncAPI adopters and their use cases.

Our Sponsors

Want to become a sponsor? Learn what we do with sponsors' money and join the club.

Platinum

IBM logo      Solace logo

Gold

Postman logo

Silver

Bump.sh logo      svix logo
hivemq logo      aklivity logo

Bronze

RedHat logo

Contributors

Thanks goes to these wonderful people (emoji key):

Fran Méndez
Fran Méndez

💬 🐛 📝 📖 🤔 🚇 🚧 👀 📢
Lukasz Gornicki
Lukasz Gornicki

📖 🤔 👀 💬 📝 📢 🚧 🚇
Mike Ralphson
Mike Ralphson

💬 📖 🤔 🚇 👀 🚧
raisel melian
raisel melian

💬 🐛 📖 🤔 🚧 👀
Chris Wood
Chris Wood

🤔 📖
Jonathan Schabowsky
Jonathan Schabowsky

📖 🤔
Victor Romero
Victor Romero

🤔 👀
Antonio Garrote
Antonio Garrote

🤔 👀 📖
Jonathan Stoikovitch
Jonathan Stoikovitch

💡 🤔 👀
Jonas Lagoni
Jonas Lagoni

🐛 📖 🤔 💬 👀 💡
Waleed Ashraf
Waleed Ashraf

📢 🤔 📖 💡
Andrzej Jarzyna
Andrzej Jarzyna

📢
Emmelyn Wang
Emmelyn Wang

📝 🤔 📖 📢
Marc DiPasquale
Marc DiPasquale

📝 📢 👀 🐛 🤔 📹
Gerald Loeffler
Gerald Loeffler

📖 🐛 🤔
Dale Lane
Dale Lane

📝 🤔 📹 📢 📖
Maciej Urbańczyk
Maciej Urbańczyk

👀 🤔 💬 🐛 📖 💡 🚧
Vladimir Gorej
Vladimir Gorej

📖 🐛 💡 🤔 👀
Lorna Jane Mitchell
Lorna Jane Mitchell

📢 🤔
Laurent Broudoux
Laurent Broudoux

📖 📝 📢 💡 🤔 👀
Jesse Menning
Jesse Menning

📝 📢 👀 🤔
Sergio Moya
Sergio Moya

👀 🤔 💬 📝 🐛 📖 💡 🚧
Alexander Balogh
Alexander Balogh

📖 🐛
Khuda Dad Nomani
Khuda Dad Nomani

💡 🐛
Aaron Korver
Aaron Korver

📖
Orlov Valentine
Orlov Valentine

📖
Moez Bouhlel
Moez Bouhlel

📖
Muhammad Rafly Andrianza
Muhammad Rafly Andrianza

📖
Daniel Kocot
Daniel Kocot

📖 💡 🤔
sekharbans-ebay
sekharbans-ebay

📖 💡 🤔
Michael Davis
Michael Davis

🐛 📖 💡 🤔
Heiko Henning
Heiko Henning

🐛 💻 🖋 📖 💡 🤔 🚧 👀
Quetzalli
Quetzalli

🖋 📖 💡 🤔 👀
Akshit Gupta
Akshit Gupta

🖋 📖
samz
samz

🐛 🖋 📖 💡 📆
Rishi
Rishi

🚧 🚇
nickshoe
nickshoe

🐛 📖
Ace
Ace

📋 🤔 🚧 📢
Animesh Kumar
Animesh Kumar

🖋 📖 🚧
Fabrizio Lazzaretti
Fabrizio Lazzaretti

📖
Pavel Bodiachevskii
Pavel Bodiachevskii

📖 🐛 🤔 💬

This project follows the all-contributors specification. Contributions of any kind welcome!

github-action-for-cli's People

Contributors

akshatnema avatar allcontributors[bot] avatar asyncapi-bot avatar christianrowlands avatar codingtenshi avatar dependabot[bot] avatar derberg avatar hutchhutchhutch avatar pioneer2k avatar shurtu-gal avatar victormartingarcia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-action-for-cli's Issues

Refactor and rename this GH Action to be fully AsyncAPI CLI based

When I worked on this action some time ago, my main motivation was:

  • provide GH action for generator
  • do it by using Generator as library because:
    • we have automated releases (for node projects) implemented in AsyncAPI organization, so I knew that whenever new Generator is released, it will trigger release of this action to also support latest release
    • because wanted to use Generator as library in production and figure how that works 🤷🏼

Now times are different 😄

I think it would be better:

  • release 3.0 version of the action
  • rename action from Generator for AsyncAPI documents to Generator, validator, converter and others - all in one for your AsyncAPI docs
  • rename repository from github-action-for-generator to github-action-for-asyncapi-cli
  • throw away all the Nodejs code and modify docker file to simply expose the AsyncAPI CLI interface - example GH Action that does it https://github.com/gaurav-nelson/github-action-markdown-link-check

Or:
Or we just archive this repo and create action directly in AsyncAPI CLI - example how a friend does it (CLI and GH action for it in one repo) https://github.com/mszostok/codeowners-validator. I think it makes sense, especially that in ourcase GH Action would anyway always reflect the CLI version. Current action we would just archive, set as deprecated and link to the new one.

Thoughts?

Github action creating pdf fails because of puppeteer

Describe the bug

Generator fails to create asyncapi pdf

How to Reproduce

Using the following step:
- name: Generating HTML from my AsyncAPI document
uses: docker://asyncapi/github-action-for-generator:2.1.12
with:
template: '@asyncapi/[email protected]'
filepath: api/src/main/resources/docs/api/my_asyncapi.yml
parameters: pdf=true
output: wiki/diagrams

Github Actions Log:
PDF is generating...
Error: Failed to launch the browser process! spawn /node_modules/@asyncapi/generator/node_modules/puppeteer/.local-chromium/linux-1002410/chrome-linux/chrome ENOENT

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/node_modules/@asyncapi/generator/node_modules/puppeteer/src/node/BrowserRunner.ts:304:[9](https://github.com/XXX/XYZ/actions/runs/6024020451/job/16341900878#step:7:10))
at ChildProcess.<anonymous> (/node_modules/@asyncapi/generator/node_modules/puppeteer/src/node/BrowserRunner.ts:296:16)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:[12](https://github.com/XXX/XYZ/actions/runs/6024020451/job/16341900878#step:7:13))
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
at onErrorNT (node:internal/child_process:485:[16](https://github.com/XXX/XYZ/actions/runs/6024020451/job/16341900878#step:7:17))
at processTicksAndRejections (node:internal/process/task_queues:83:21)

Expected behavior

Should create a beautiful pdf of my asyncapi.

Cannot find module 'read-package-json-fast' when using v1.0.37

Describe the bug
When using the asyncapi/[email protected] (and 1.0.36 as well) I get the following error in GitHub Actions:

Error: Cannot find module 'read-package-json-fast'
Require stack:

  • /home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.37/node_modules/@npmcli/run-script/lib/run-script.js
  • /home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.37/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.37/node_modules/@npmcli/run-script/lib/run-script.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)

How to Reproduce
use the github-action with v1.0.37 like this

  • name: Generating HTML from AsyncAPI document
    uses: asyncapi/[email protected]
    with:
    template: '@asyncapi/[email protected]'
    filepath: src/main/resources/asyncapi.yml
    parameters: baseHref=/customer-context-asyncapi-generated-html/
    output: asyncapi/customer-context-asyncapi-generated-html
    Expected behavior
    no error

Cannot find module '@npmcli/run-script' when using v1.0.33

Describe the bug
When using the asyncapi/[email protected] (maybe 1.0.32 as well) I get the following error in GitHub Actions:

Error: Cannot find module '@npmcli/run-script'
Require stack:

  • /home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.27352 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/external "@npmcli/run-script":1:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/webpack/bootstrap:21:1)
    at Object.9699 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/node_modules/pacote/lib/dir.js:13:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/webpack/bootstrap:21:1)
    at Object.97545 (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/node_modules/pacote/lib/git.js:4:1)
    at nccwpck_require (/home/runner/work/_actions/asyncapi/github-action-for-generator/v1.0.33/webpack:/github-action-for-generator/webpack/bootstrap:21:1)

With v1.0.31 everything is working. But we need the new version for fixing the issue 103.

How to Reproduce
use the github-action with v1.0.33 like this

 - name: Generating HTML from AsyncAPI document
    uses: asyncapi/[email protected]
    with:
      template: '@asyncapi/[email protected]' 
      filepath: src/main/resources/asyncapi.yml
      parameters: baseHref=/customer-context-asyncapi-generated-html/
      output: asyncapi/customer-context-asyncapi-generated-html

Expected behavior
no error

Version 2.3 not supported

Describe the bug

Currently, if you use the GH action on 2.3 documents it throws Error: Version 2.3.0 is not supported.

This is part of version 1.9.0 of the generator, which does not seem to have been updated here 🤔

To fix this, the dependencies need to be updated, or rather inspected, why the dependency was not automatically updated.

html-template 0.22.x causes an error

Describe the bug

When using the html-template 0.22.x (maybe earlier) I get the following error in GitHub Actions:

Error: This template is not compatible with the current version of the generator (1.0.1). This template is compatible with the following version range: >=1.7.3 <2.0.0.

With html-template 0.20.1 everything is working.

How to Reproduce

use the github-action with html-template 0.22.3 like this

     - name: Generating HTML from AsyncAPI document
        uses: asyncapi/[email protected]
        with:
          template: '@asyncapi/[email protected]' 
          filepath: src/main/resources/asyncapi.yml
          parameters: baseHref=/customer-context-asyncapi-generated-html/
          output: asyncapi/customer-context-asyncapi-generated-html

Expected behavior

no error

Allow variable node version

Reason/Context

Had a use case where a dependency for a template needed >= v14 however this action runs with v12, making them incompatible.

Description

Would be great if it offered a way to use different node versions for the generation.

Add docker support for GitHub action

Describe the bug

  • Pulling an image from docker will not work on action.
  • The image has to be added in action.yml for proper functioning.

TO-DO

  • Update README to use official names as per marketplace instead of docker-image
  • Add support for a bump of version in action.yml version.

Version 2.4.0 not supported

Describe the bug

The step to generate the HTML from the AsyncAPI document does not work with version 2.4.0

Screenshot 2022-08-16 at 08 08 11

How to Reproduce

Github action step:

    #In case you do not want to use defaults, you for example want to use different template
    - name: Generating HTML from my AsyncAPI document
      uses: docker://asyncapi/github-action-for-generator:2.0.3
      with:
        template: '@asyncapi/[email protected]'  #In case of template from npm, because of @ it must be in quotes
        filepath: CORE.yaml
        output: generated-html

AsyncAPI yaml file:

asyncapi: '2.4.0'
info:
  title: My service
  version: 0.0.1
  description: Service description

Cleanup GitHub Actions workflows

Context

  1. We want to make sure we have healthy community and people respec each other in GitHub. We want to monitor all comments in every repository and analyze sentiments to identify negative ones and get proper notification. Idea is to use GitHub Actions for it, to check sentiments with Google Natural Language API and post negative comments to Slack for review.

  2. We manage community files in global .github repo, and we have GitHub Funding config file there too. As a result we need to cleanup all the repos to remove .github/FUNDING.yml

  3. Start supporting new GitHub pull request event that allows gives access to GITHUB_TOKEN with write access. Fix welcome contributors workflow is needed.

  4. We want to automatically merge Pull Requests that are submitted by Dependanbot. New workflow needs to be added, or if already existins it needs to be modified

Description

  1. Add this workflow file called sentiment-analysis.yml to .github/workflows (create it if it doesn't exist yet) directory: https://gist.github.com/derberg/ab362e4b37f542e7e1813e67b7cb11ee
    Proper secrets are already added to GitHub organization so it is as simple as adding above file to workflows dir.
  2. Remove .github/FUNDING.yml if it exists
  3. If not done already rename pull_request from line 4 to pull_request_target in .github/workflows/welcome-first-time-contrib.yml file
  4. Create new file called automerge.yml with the following content: https://gist.github.com/derberg/024814a26959d54f683e7bd68d68f007
    If the repository already has a file called automerge-release-pr-bump.yml than rename it and adjust if statements to check github.actor == 'asyncapi-bot' || github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' instead of github.actor == 'asyncapi-bot'

[BUG] Java --javaIncludeComments --javaJackson leads to Compilationfailure

Describe the bug.

Java --javaIncludeComments --javaJackson leads to Compilationfailure

Expected behavior

Generating the models normally

Screenshots

image

How to Reproduce

jobs:
package-and-upload:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Checkout repo
- name: Checkout repo
uses: actions/checkout@v2

  # Generating models from my AsyncAPI document
  - name: Generating models from my AsyncAPI document
    uses: asyncapi/[email protected]
    with:
      command: generate
      filepath: docs/asyncapi.yaml
      language: java
      parameters: --packageName=com.example --javaIncludeComments --javaJackson
      output: generated-models

🥦 Browser

None

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

No, someone else can work on it

Need for urgent changes in GitHub Actions automation

This issue defines a list of tasks that need to be performed in this repo to make sure it's ci/cd automation works long term without any issues.

It is up to maintainers to decide if it must be addressed in one or multiple PRs.

Below are 3 different sections describing 3 different important ci/cd changes.

IMPORTANT-START
For GitHub workflows that contain This workflow is centrally managed in https://github.com/asyncapi/.github/ you do not have to perform any work. These workflows were already updated through the update in .github. The only exception is the workflows related to nodejs release. More details in Upgrade Release pipeline - in case of nodejs projects section
IMPORTANT-END

Deprecation of way data is shared between steps

Every single GitHub Action workflow that has echo "::set-output name={name}::{value}" need to be updated to follow echo "{name}={value}" >> $GITHUB_OUTPUT

We do not yet know when set-output will stop working. Previous disable date was 31.05 but now then say community needs more time.

For more details read official article from GitHub

Deprecation of node12

2nd bullet point is still relevant for you even if your projects in not nodejs project

  • Every single workflow that uses setup-node action needs an update to follow v3 version of this action, and make sure minimum node 14 is used
  • Now this part is more complex. Problem with node12 is that node-based GitHub Actions were using it in majority as a runtime environment. Look for example at this action.yaml file for setup-node action v2. So the job that you have to do is go through all the workflows, and verify every single action that you use, make sure you are using the latest version that is not based on node12. I already did review a lot of actions as part of this PR so maybe you will find some actions there and can copy from me. For example action/checkout needs to be updated to v3.

Node12 end of support in action is probably September 27th.

For more details read official article from GitHub

Upgrade Release pipeline - in case of nodejs projects

ignore this section if your project is not nodejs project

You have 2 options. You can:

A. choose to switch to new release pipeline using instruction from asyncapi/.github#205

B. stay with old release pipeline, and manually update GitHub workflows and actions used in it, you can inspire a lot from this PR asyncapi/.github#226

I definitely recommend going with A

Workflows related to release:

  • .github/workflows/if-nodejs-release.yml
  • .github/workflows/if-nodejs-version-bump.yml
  • .github/workflows/bump.yml

github-action-for-generator: Error: Found non-callable @@iterator

Bug Description:

Following error occurs when generating HTML from my AsyncAPI document with the latest versions of github-action-for-generator and html-template in my GitHub Actions

[BABEL] Note: The code generator has deoptimised the styling of /node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.
Error: Found non-callable @@iterator

image

How to Reproduce

Please see source files and steps to produce as GitHub Action definition file.

Complete GitHub Action:

name: AsyncAPI documents processing
on: push
permissions:
  contents: write
jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
    #"standard step" where repo needs to be checked-out first
    - name: Checkout repo
      uses: actions/checkout@v2
      
    #Using another action for AsyncAPI for validation
    - name: Validating AsyncAPI document
      uses: WaleedAshraf/[email protected]
      with:
        filepath: docs/api/my-asyncapi.yml
      
    #In case you do not want to use defaults, you for example want to use different template
    - name: Generating HTML from my AsyncAPI document
      uses: docker://asyncapi/github-action-for-generator:latest  #always use latest tag as each is pushed to docker
      with:
        template: '@asyncapi/[email protected]'  #In case of template from npm, because of @ it must be in quotes
        filepath: docs/api/my-asyncapi.yml
        parameters: baseHref=/test-experiment/ sidebarOrganization=byTags #space separated list of key/values
        output: generated-html
        
    #Using another action that takes generated HTML and pushes it to GH Pages
    - name: Deploy GH page
      uses: JamesIves/[email protected]
      with:
        ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        BRANCH: feature/asyncapi-integration
        FOLDER: generated-html

API Description Used:

asyncapi: 2.0.0
info:
  title: Account Service
  version: '1.0.0'
  description: |
    Manages user accounts in the system.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0

servers:
  production:
    url: mqtt://test.mosquitto.org
    protocol: mqtt
    description: Test MQTT broker

channels:
  user/signedup:
    subscribe:
      operationId: emitUserSignUpEvent
      message:
        $ref : '#/components/messages/UserSignedUp'

components:
  messages:
    UserSignedUp:
      name: userSignedUp
      title: User signed up event
      summary: Inform about a new user registration in the system
      contentType: application/json
      payload:
        $ref: '#/components/schemas/userSignedUpPayload'

  schemas:
    userSignedUpPayload:
      type: object
      properties:
        firstName:
          type: string
          description: "foo"
        lastName:
          type: string
          description: "bar"
        email:
          type: string
          format: email
          description: "baz"
        createdAt:
          type: string
          format: date-time

Migrate package-lock.json file to version 2

Reason/Context

Parser-JS requires now Node.js 14 and npm7 or higher.
This means package-lock.json version should be always set to 2.

Description

In order to unify development requirements, I suggest all repositories to stick with that requirements. In order to do that, the following is needed:

  • Clarify this requirement under Development section on this repository README file.
  • To update package-lock.json to version 2. This is automatically done when running npm install if the npm version used is 7 or higher.

Related:

Error: Custom transpiler can only be used when transpileOnly is enabled

Describe the bug

A clear and concise description of what the bug is:

ts-node throws error when following github-action-for-generator documentation and copy-pasted the workflow file for a hello world example.

Run docker://asyncapi/github-action-for-generator:2.1.9
  with:
    template: @asyncapi/[email protected]
    filepath: docs/api/my-asyncapi.yml
    parameters: baseHref=/test-experiment/ sidebarOrganization=byTags
    output: generated-html
/usr/bin/docker run --name asyncapigithubactionforgenerator219_717785 --label ea425b --workdir /github/workspace --rm -e "INPUT_TEMPLATE" -e "INPUT_FILEPATH" -e "INPUT_PARAMETERS" -e "INPUT_OUTPUT" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/asyncapi-test/asyncapi-test":"/github/workspace" asyncapi/github-action-for-generator:2.1.9

/dist/index.js:268478
                throw new Error('Custom transpiler can only be used when transpileOnly is enabled.');
                      ^
Error: Custom transpiler can only be used when transpileOnly is enabled.
    at initializeTranspilerFactory (/dist/index.js:268478:23)
    at createFromPreloadedConfig (/dist/index.js:268473:28)
    at create (/dist/index.js:268385:12)
    at register (/dist/index.js:268365:19)
    at utils.registerTypeScript (/dist/index.js:13043:3)
    at Object.56814 (/webpack:/github-action-for-generator/node_modules/@asyncapi/generator/lib/generator.js:64:1)
    at __nccwpck_require__ (/webpack:/github-action-for-generator/webpack/bootstrap:21:1)
    at /webpack:/github-action-for-generator/lib/index.js:2:1
    at /dist/index.js:297843:3
    at Object.<anonymous> (/dist/index.js:297846:12)

How to Reproduce

Steps to reproduce the issue. Attach all resources that can help us understand the issue:

Here is a hello world repo that exhibits the error:
https://github.com/perdue/asyncapi-test

docs/api/my-asyncapi.yml:

asyncapi: 2.4.0
info:
  title: Hello world application
  version: '0.1.0'
channels:
  hello:
    publish:
      message:
        payload:
          type: string
          pattern: '^hello .+$'

.github/workflows/generate.yml:

name: AsyncAPI documents processing

on:
  push:
    branches: [ main ]

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
    #"standard step" where repo needs to be checked-out first
    - name: Checkout repo
      uses: actions/checkout@v2
      
    #Using another action for AsyncAPI for validation
    - name: Validating AsyncAPI document
      uses: WaleedAshraf/[email protected]
      with:
        filepath: docs/api/my-asyncapi.yml
      
    #In case you do not want to use defaults, you for example want to use different template
    - name: Generating HTML from my AsyncAPI document
      uses: docker://asyncapi/github-action-for-generator:2.1.9
      with:
        template: '@asyncapi/[email protected]'  #In case of template from npm, because of @ it must be in quotes
        filepath: docs/api/my-asyncapi.yml
        parameters: baseHref=/test-experiment/ sidebarOrganization=byTags #space separated list of key/values
        output: generated-html
      
    #Using another action that takes generated HTML and pushes it to GH Pages
    - name: Deploy GH page
      uses: JamesIves/[email protected]
      with:
        ACCESS_TOKEN: ${{ secrets.DEPLOY_TO_GITHUB_TOKEN }}
        BRANCH: gh-pages
        FOLDER: generated-html

Expected behavior

A clear and concise description of what you expected to happen:

I expected the generator to produce the correct output considering I was following the README.

Version 2.2.0 is not supported error

Got Error: Version 2.2.0 is not supported. when setting GH actions job.

Logs:

Run asyncapi/github-action-for-generator@v1
  with:
    template: @asyncapi/[email protected]
    filepath: backend/docs/asyncapi.yml
    parameters: baseHref=/test-experiment/ sidebarOrganization=byTags
    output: generated-html
(node:2002) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Error: Version 2.2.0 is not supported.

GH actions configuration:

name: AsyncAPI documents processing

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
    
    - name: Checkout repo
      uses: actions/checkout@v2

    - name: Generating HTML from my AsyncAPI document
      uses: asyncapi/github-action-for-generator@v1
      with:
        template: '@asyncapi/[email protected]' # latest
        filepath: backend/docs/asyncapi.yml
        parameters: baseHref=/test-experiment/ sidebarOrganization=byTags
        output: generated-html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.