Skip to content

Commit

Permalink
Try diff script
Browse files Browse the repository at this point in the history
  • Loading branch information
wenovus committed Aug 2, 2023
1 parent 502f994 commit ec4a4ef
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/diff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: OpenConfig YANG Diff

on:
pull_request:
branches: [ master ]

jobs:
build:
name: Backward Incompatibility Check
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Make sure all backward-incompatible changes are covered by version changes.
run: |
readonly HEAD=${{ github.event.pull_request.head.sha }}
readonly BASE="$(git merge-base origin/main "${HEAD}")"
BASEREPODIR=public_base
git clone "[email protected]:public.git" "${BASEREPODIR}" --branch "${BASE}"
oldroot="${BASEREPODIR}"
newroot=.
oldfiles=$(find "${oldroot}"/release/models -name '*.yang' | tr '\n' ',')
newfiles=$(find "${newroot}"/release/models -name '*.yang' | tr '\n' ',')
go install github.com/openconfig/models-ci@diff-cli
models-ci diff --disallowed-incompats --oldp "${oldroot}/third_party" --oldfiles "${oldfiles}" --newp "${newroot}/third_party" --newfiles "${newfiles}"

0 comments on commit ec4a4ef

Please sign in to comment.