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 <yurii.shynbuiev@iohk.io>
  • Loading branch information
yshyn-iohk committed May 7, 2024
1 parent 46e594c commit 17feffa
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 }}





0 comments on commit 17feffa

Please sign in to comment.