From e622138a6f35db7b925a23eff2db87b71ed416c2 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Sun, 1 Mar 2026 21:08:18 +0200 Subject: [PATCH 1/5] demo: API changes with pr-comment workflow - Remove 400 response from POST /api/v1.0/groups - Remove pattern constraint from 'created' field - Add 'description' property to GroupView - Add GET /api/v1.0/groups/{groupId} endpoint - Add pr-comment workflow to demonstrate oasdiff PR comment --- .github/workflows/pr-comment.yml | 30 ++++++++++++++++++++++++++++++ simple.yaml | 20 +++++++++++++++----- 2 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pr-comment.yml diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml new file mode 100644 index 0000000..68b4f59 --- /dev/null +++ b/.github/workflows/pr-comment.yml @@ -0,0 +1,30 @@ +name: oasdiff PR comment + +on: + pull_request: + +permissions: + contents: read + pull-requests: write + +jobs: + pr-comment: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Get prev commit + run: echo "PREV_COMMIT=$(git --no-pager log --skip=1 --max-count=1 | grep commit | cut -d' ' -f2)" >> $GITHUB_ENV + + - name: Get prev file + run: echo "PREV_FILE=$(echo https://raw.githubusercontent.com/oasdiff/github-demo/${{ env.PREV_COMMIT }}/simple.yaml)" >> $GITHUB_ENV + + - name: Post oasdiff PR comment + uses: oasdiff/oasdiff-action/pr-comment@main + with: + base: ${{ env.PREV_FILE }} + revision: simple.yaml + oasdiff-token: 0634345d-02fb-43df-b56a-68fc22253621 diff --git a/simple.yaml b/simple.yaml index b635d93..f25abf1 100644 --- a/simple.yaml +++ b/simple.yaml @@ -1,7 +1,7 @@ openapi: 3.0.1 info: title: Tufin - version: "3.0" + version: "4.0" servers: - url: https://localhost:8080 components: @@ -23,12 +23,13 @@ components: type: string format: date-time readOnly: true - pattern: "^[a-z]+$" id: type: string readOnly: true name: type: string + description: + type: string required: - name paths: @@ -51,10 +52,19 @@ paths: schema: $ref: '#/components/schemas/GroupView' description: SUCCESS - "400": + summary: Create a Project + /api/v1.0/groups/{groupId}: + get: + tags: + - Group + operationId: getOneGroup + parameters: + - $ref: '#/components/parameters/groupId' + responses: + "200": content: application/json: schema: $ref: '#/components/schemas/GroupView' - description: Conflict - summary: Create a Project + description: SUCCESS + summary: Get a Project From b27527fe7598514f5a02713fb684f3c22ead7f70 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Sun, 1 Mar 2026 21:43:07 +0200 Subject: [PATCH 2/5] retrigger workflow From 36a5910de0cb5c9d8007df19a719082af86e1410 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Sun, 1 Mar 2026 21:44:42 +0200 Subject: [PATCH 3/5] fix: compare against base branch instead of previous commit --- .github/workflows/pr-comment.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index 68b4f59..ed88fb6 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -13,18 +13,10 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Get prev commit - run: echo "PREV_COMMIT=$(git --no-pager log --skip=1 --max-count=1 | grep commit | cut -d' ' -f2)" >> $GITHUB_ENV - - - name: Get prev file - run: echo "PREV_FILE=$(echo https://raw.githubusercontent.com/oasdiff/github-demo/${{ env.PREV_COMMIT }}/simple.yaml)" >> $GITHUB_ENV - name: Post oasdiff PR comment uses: oasdiff/oasdiff-action/pr-comment@main with: - base: ${{ env.PREV_FILE }} + base: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.base_ref }}/simple.yaml revision: simple.yaml oasdiff-token: 0634345d-02fb-43df-b56a-68fc22253621 From b0601c0f49a2469c94dea46ba3a72627a03ff54e Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Sun, 1 Mar 2026 21:50:35 +0200 Subject: [PATCH 4/5] retrigger: test base branch links From bc44ba4eada8379ff4e6959fd492f4f4d688d500 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Sun, 1 Mar 2026 21:54:19 +0200 Subject: [PATCH 5/5] retrigger: test base branch links after deploy