Skip to content

Commit

Permalink
ci: semantic-release upgrade, oasdiff fix (#1017)
Browse files Browse the repository at this point in the history
Signed-off-by: Yurii Shynbuiev <[email protected]>
Signed-off-by: Pat Losoponkul <[email protected]>
  • Loading branch information
yshyn-iohk authored and Pat Losoponkul committed Jun 13, 2024
1 parent 2108aba commit 3fbafb7
Show file tree
Hide file tree
Showing 3 changed files with 805 additions and 1,153 deletions.
57 changes: 29 additions & 28 deletions .github/workflows/oasdiff.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: "OAS Breaking Changes"


defaults:
run:
shell: bash
Expand All @@ -10,7 +9,6 @@ on:
pull_request:
branches:
- main

workflow_dispatch:
inputs:
revision_tag:
Expand All @@ -23,6 +21,10 @@ on:
description: "Base tag to check the breaking changes in the OAS"
default: "main"

permissions:
pull-requests: write
actions: write

# https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/prism-agent-v1.29.0/prism-agent/service/api/http/prism-agent-openapi-spec.yaml
# https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/main/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml

Expand All @@ -32,32 +34,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Resolve the base OpenAPI spec URL
env:
BASE_TAG: ${{ github.event.inputs.base_tag }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
run: |
BASE_TAG="${{ github.event.inputs.base_tag }}"
echo "Base tag: $BASE_TAG"
if [[ $BASE_TAG == 'cloud-agent-v*' ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/$BASE_TAG/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> $GITHUB_ENV
elif [[ $BASE_TAG == 'prism-agent-v*' ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/$BASE_TAG/prism-agent/service/api/http/prism-agent-openapi-spec.yaml" >> $GITHUB_ENV
elif [[ $BASE_TAG == 'main' ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/$BASE_TAG/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> $GITHUB_ENV
elif [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/main/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> $GITHUB_ENV
echo Base tag: "$BASE_TAG"
if [[ "$BASE_TAG" =~ cloud-agent-v* ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${BASE_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$BASE_TAG" =~ prism-agent-v* ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${BASE_TAG}/prism-agent/service/api/http/prism-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$BASE_TAG" == 'main' ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${BASE_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$GITHUB_EVENT_NAME" == 'pull_request' ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/main/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
fi
- name: Resolve the revision OpenAPI spec URL
env:
REV_TAG: ${{ github.event.inputs.revision_tag }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
REV_TAG="${{ github.event.inputs.revision_tag }}"
echo "Revision tag: $REV_TAG"
if [[ $REV_TAG == 'cloud-agent-v*' ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/$REV_TAG/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> $GITHUB_ENV
elif [[ $REV_TAG == 'prism-agent-v*' ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/$REV_TAG/prism-agent/service/api/http/prism-agent-openapi-spec.yaml" >> $GITHUB_ENV
elif [[ $REV_TAG == 'main' ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/$REV_TAG/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> $GITHUB_ENV
elif [[ ${{ github.event_name }} == 'pull_request' ]]; then
BRANCH_NAME=${{ github.head_ref || github.ref_name }}
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/$BRANCH_NAME/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> $GITHUB_ENV
echo Revision tag: "$REV_TAG"
if [[ "$REV_TAG" =~ cloud-agent-v* ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${REV_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$REV_TAG" =~ prism-agent-v* ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${REV_TAG}/prism-agent/service/api/http/prism-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$REV_TAG" == 'main' ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${REV_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$GITHUB_EVENT_NAME" == 'pull_request' ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${BRANCH_NAME}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
fi
- name: Check URLS
Expand All @@ -71,8 +77,3 @@ jobs:
fail-on-diff: false
base: ${{ env.BASE_URL }}
revision: ${{ env.REV_URL }}





Loading

0 comments on commit 3fbafb7

Please sign in to comment.