Skip to content

Commit

Permalink
Add action for updating schema visualizer in the website
Browse files Browse the repository at this point in the history
  • Loading branch information
AceTheCreator committed Jan 9, 2025
1 parent ecfe8d6 commit 2d2020f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/copy-updated-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
push:
branches:
- master
- automate-spec-update-to-website
paths:
- schemas/3.0.0-without-$id.json # Monitor changes in this v3 file
# Monitor changes in this v3 file
- schemas/3.0.0-without-$id.json
- schemas/3.0.0.json

jobs:
sync-schema:
Expand All @@ -16,42 +17,33 @@ jobs:
- name: Checkout spec-json-schema repo
uses: actions/checkout@v3

- name: Debug Token Presence
run: |
if [ -n "${{ secrets.GH_TOKEN }}" ]; then
echo "Token is present"
else
echo "Token is empty"
fi
- name: Checkout website repo
uses: actions/checkout@v3
with:
repository: acethecreator/website
token: ${{ secrets.GH_TOKEN }}
repository: asyncapi/website
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
path: ./website

- name: Copy Schema File
- name: Copy version 3 Schema File
run: |
cp -r schemas/3.0.0-without-\$id.json website/config
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
path: website
commit-message: "chore: sync latest schema updates"
commit-message: "chore: sync latest spec json schema updates"
committer: asyncapi-bot <[email protected]>
author: asyncapi-bot <[email protected]>
title: "chore: sync latest schema update"
title: "chore: sync latest spec-json-schema update"
body: |
Automated PR to sync latest schema update from spec-json-schema repository.
Automated Pull Request to sync latest schema update from spec-json-schema repository.
Updates to: `3.0.0-without-$id.json`
Triggered by commit: ${{ github.sha }}
branch: update-schema
Updates to: `config/3.0.0-without-$id.json`
branch: update-schema/${{ github.sha }}
labels: |
automated
schema-sync
spec-json-schema-sync
base: master
delete-branch: true
6 changes: 3 additions & 3 deletions schemas/3.0.0-without-$id.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
{
"title": "AsyncAPI Sample App",
"version": "1.0.1",
"description": "This is a test",
"description": "This is a sample app.",
"termsOfService": "https://asyncapi.org/terms/",
"contact": {
"name": "API Support",
Expand All @@ -135,7 +135,7 @@
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"externalDocs": {
"description": "Find more info",
"description": "Find more info here",
"url": "https://www.asyncapi.org"
},
"tags": [
Expand All @@ -148,7 +148,7 @@
},
"contact": {
"type": "object",
"description": "Contact information",
"description": "Contact information for the exposed API.",
"additionalProperties": false,
"properties": {
"name": {
Expand Down

0 comments on commit 2d2020f

Please sign in to comment.