Skip to content

Commit e622138

Browse files
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
1 parent be62b48 commit e622138

2 files changed

Lines changed: 45 additions & 5 deletions

File tree

.github/workflows/pr-comment.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: oasdiff PR comment
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
10+
jobs:
11+
pr-comment:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Get prev commit
20+
run: echo "PREV_COMMIT=$(git --no-pager log --skip=1 --max-count=1 | grep commit | cut -d' ' -f2)" >> $GITHUB_ENV
21+
22+
- name: Get prev file
23+
run: echo "PREV_FILE=$(echo https://raw.githubusercontent.com/oasdiff/github-demo/${{ env.PREV_COMMIT }}/simple.yaml)" >> $GITHUB_ENV
24+
25+
- name: Post oasdiff PR comment
26+
uses: oasdiff/oasdiff-action/pr-comment@main
27+
with:
28+
base: ${{ env.PREV_FILE }}
29+
revision: simple.yaml
30+
oasdiff-token: 0634345d-02fb-43df-b56a-68fc22253621

simple.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.1
22
info:
33
title: Tufin
4-
version: "3.0"
4+
version: "4.0"
55
servers:
66
- url: https://localhost:8080
77
components:
@@ -23,12 +23,13 @@ components:
2323
type: string
2424
format: date-time
2525
readOnly: true
26-
pattern: "^[a-z]+$"
2726
id:
2827
type: string
2928
readOnly: true
3029
name:
3130
type: string
31+
description:
32+
type: string
3233
required:
3334
- name
3435
paths:
@@ -51,10 +52,19 @@ paths:
5152
schema:
5253
$ref: '#/components/schemas/GroupView'
5354
description: SUCCESS
54-
"400":
55+
summary: Create a Project
56+
/api/v1.0/groups/{groupId}:
57+
get:
58+
tags:
59+
- Group
60+
operationId: getOneGroup
61+
parameters:
62+
- $ref: '#/components/parameters/groupId'
63+
responses:
64+
"200":
5565
content:
5666
application/json:
5767
schema:
5868
$ref: '#/components/schemas/GroupView'
59-
description: Conflict
60-
summary: Create a Project
69+
description: SUCCESS
70+
summary: Get a Project

0 commit comments

Comments
 (0)