-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add docker support to action directly (#375)
- Loading branch information
1 parent
e050f87
commit 01993be
Showing
8 changed files
with
164 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ coverage | |
.DS_Store | ||
output | ||
node_modules | ||
dist | ||
dist | ||
test/unoptimized_optimized.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ Sample usage: | |
|
||
```yaml | ||
- name: Generating HTML from my AsyncAPI document | ||
uses: docker://asyncapi/github-action-for-cli:2.0.0 | ||
uses: asyncapi/github-action-for-cli@v3.0.2 # You can use any version you want | ||
with: | ||
custom_command: bundle ./asyncapi.yaml --output final-asyncapi.yaml | ||
``` | ||
|
@@ -91,15 +91,20 @@ The command that you use might support and even require specific parameters to b | |
> [!NOTE] | ||
> For template parameters, you need to pass them as `-p <template_parameters>` as can be seen in CLI documentation. | ||
|
||
|
||
## Example usage | ||
|
||
> [!WARNING] | ||
> 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. | ||
> 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. | ||
|
||
### Basic | ||
|
||
In case all defaults are fine for you, just add such step: | ||
|
||
```yaml | ||
- name: Generating Markdown from my AsyncAPI document | ||
uses: docker://asyncapi/github-action-for-cli:3.0.0 | ||
uses: asyncapi/github-action-for-cli@v3.0.2 # You can use any version you want | ||
``` | ||
|
||
### Using all possible inputs | ||
|
@@ -108,7 +113,7 @@ In case you do not want to use defaults, you for example want to use different t | |
|
||
```yaml | ||
- name: Generating HTML from my AsyncAPI document | ||
uses: docker://asyncapi/github-action-for-cli:3.0.0 | ||
uses: asyncapi/github-action-for-cli@v3.0.2 # You can use any version you want | ||
with: | ||
command: generate | ||
filepath: ./docs/api/asyncapi.yaml | ||
|
@@ -140,7 +145,7 @@ jobs: | |
#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-cli:3.0.0 | ||
uses: asyncapi/github-action-for-cli@v3.0.2 # You can use any version you want | ||
with: | ||
template: '@asyncapi/[email protected]' #In case of template from npm, because of @ it must be in quotes | ||
filepath: docs/api/my-asyncapi.yml | ||
|
@@ -177,7 +182,7 @@ jobs: | |
uses: actions/checkout@v2 | ||
- name: Generating models from my AsyncAPI document | ||
uses: docker://asyncapi/github-action-for-cli:3.0.0 | ||
uses: asyncapi/github-action-for-cli@v3.0.2 # You can use any version you want | ||
with: | ||
command: generate | ||
filepath: docs/api/my-asyncapi.yml | ||
|
@@ -205,7 +210,7 @@ jobs: | |
uses: actions/checkout@v2 | ||
- name: Validating AsyncAPI document | ||
uses: docker://asyncapi/github-action-for-cli:3.0.0 | ||
uses: asyncapi/github-action-for-cli@v3.0.2 # You can use any version you want | ||
with: | ||
command: validate | ||
filepath: docs/api/my-asyncapi.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
version=$(cat package.json | jq -r '.version'); | ||
action=$(cat action.yml); | ||
regex='docker:\/\/asyncapi\/github-action-for-cli:([0-9.]+)' | ||
|
||
[[ $action =~ $regex ]] | ||
|
||
action_version=${BASH_REMATCH[1]}; | ||
|
||
echo "Action version: $action_version"; | ||
echo "Package version: $version"; | ||
|
||
if [[ $action_version > $version ]]; then | ||
echo "Action version is greater than package version"; | ||
else \ | ||
echo "Action version has not been bumped. Please bump the action version to the semantically correct version after $$version"; \ | ||
exit 1; \ | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters