Skip to content

Commit

Permalink
test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jjenscodee committed Jan 16, 2024
1 parent b41923e commit 583b5dd
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 41 deletions.
5 changes: 4 additions & 1 deletion .github/actions/bundle-schema/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
schema:
description: "The name of the schema"
required: true
branch-name:
description: "The name of the branch"
required: true

runs:
using: composite
Expand Down Expand Up @@ -49,7 +52,7 @@ runs:
git config --global user.name github-actions[bot]
git config --global user.email github-actions[bot]@users.noreply.github.com
git fetch
git checkout ci/update-schemas
git checkout ${{ inputs.branch-name }}
git pull
git add .
git diff-index --quiet HEAD || git commit -m "docs: ${{ inputs.schema }} ${{ steps.versions.outputs.version_only }}"
Expand Down
79 changes: 41 additions & 38 deletions .github/workflows/bundle-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,44 @@ jobs:
git config --global user.email github-actions[bot]@users.noreply.github.com
BRANCH_NAME="ci/update-schemas-$(date +%s)"
echo "Generated branch name: $BRANCH_NAME"
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT
git checkout -b $BRANCH_NAME
git push -u origin $BRANCH_NAME
# - name: Bundle & Push JSON schema for application schemas
# uses: ./.github/actions/bundle-schema
# with:
# schema-path: ./schemas/applications/schema/application.schema.json
# schema: application.schema.json
# - name: Bundle & Push JSON schema for component-descriptions schemas
# uses: ./.github/actions/bundle-schema
# with:
# schema-path: ./schemas/component-descriptions/schema/component.schema.json
# schema: component.schema.json
# - name: Bundle & Push JSON schema for controller schemas
# uses: ./.github/actions/bundle-schema
# with:
# schema-path: ./schemas/controller-descriptions/schema/controller.schema.json
# schema: controller.schema.json
# - name: Checkout branch ci/update-schemas
# uses: actions/checkout@v3
# with:
# ref: ci/update-schemas
# - name: Create pull request
# shell: bash
# run: |
# MESSAGE=$(
# gh pr create \
# -B main \
# -H ci/update-schemas \
# --title 'ci: update schemas' \
# --body 'This PR was automatically created by GitHub actions in response to schema changes. Please review and update any impacted code before merging the changes.' \
# --reviewer domire8 \
# --reviewer eeberhard \
# 2>&1
# ) || echo "::warning::Error creating the PR: $MESSAGE"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
echo "branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
git checkout -b ${BRANCH_NAME}
git push -u origin ${BRANCH_NAME}
- name: Bundle & Push JSON schema for application schemas
uses: ./.github/actions/bundle-schema
with:
schema-path: ./schemas/applications/schema/application.schema.json
schema: application.schema.json
branch-name: ${{ steps.branch-name.outputs.branch_name }}
- name: Bundle & Push JSON schema for component-descriptions schemas
uses: ./.github/actions/bundle-schema
with:
schema-path: ./schemas/component-descriptions/schema/component.schema.json
schema: component.schema.json
branch-name: ${{ steps.branch-name.outputs.branch_name }}
- name: Bundle & Push JSON schema for controller schemas
uses: ./.github/actions/bundle-schema
with:
schema-path: ./schemas/controller-descriptions/schema/controller.schema.json
schema: controller.schema.json
branch-name: ${{ steps.branch-name.outputs.branch_name }}
- name: Checkout branch ci/update-schemas
uses: actions/checkout@v3
with:
ref: ${{ steps.branch-name.outputs.branch_name }}
- name: Create pull request
shell: bash
run: |
MESSAGE=$(
gh pr create \
-B main \
-H ${{ steps.branch-name.outputs.branch_name }} \
--title 'ci: update schemas' \
--body 'This PR was automatically created by GitHub actions in response to schema changes. Please review and update any impacted code before merging the changes.' \
--reviewer domire8 \
--reviewer eeberhard \
2>&1
) || echo "::warning::Error creating the PR: $MESSAGE"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion schemas/applications/schema/application.schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "/1-1-0/application.schema.json",
"$id": "/0-0-0/application.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "YAML Application Description",
"description": "An AICA application graph description using YAML syntax.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "/1-0-0/component.schema.json",
"$id": "/0-0-0/component.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Dynamic Component Description",
"description": "A full description of a dynamic component in the AICA application framework.",
Expand Down

0 comments on commit 583b5dd

Please sign in to comment.