Skip to content

Test comment

Test comment #26

Workflow file for this run

name: OpenConfig YANG Diff
on:
pull_request:
branches: [ master ]
jobs:
build:
name: Backward Incompatibility Check
runs-on: ubuntu-latest
steps:
- name: Install go
uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install models-ci CLI
run: |
go install github.com/openconfig/models-ci@15b19a4
- name: Make sure all backward-incompatible changes are covered by version changes.
run: |

Check failure on line 28 in .github/workflows/diff.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/diff.yaml

Invalid workflow file

You have an error in your yaml syntax on line 28
readonly HEAD=${{ github.event.pull_request.head.sha }}
readonly BASE="$(git merge-base origin/master "${HEAD}")"
BASEREPODIR=public_base
mkdir -p "${BASEREPODIR}/release"
git checkout "${BASE}"
cp -r release/models "${BASEREPODIR}/release"
cp -r third_party "${BASEREPODIR}"
git checkout "${HEAD}"
oldroot="${BASEREPODIR}"
newroot=.
oldfiles=$(find "${oldroot}"/release/models -name '*.yang' | tr '\n' ',')
newfiles=$(find "${newroot}"/release/models -name '*.yang' | tr '\n' ',')
models-ci diff --disallowed-incompats --oldp "${oldroot}/third_party" --oldfiles "${oldfiles}" --newp "${newroot}/third_party" --newfiles "${newfiles}"
leafchanges=$(models-ci diff --oldp "${oldroot}/third_party" --oldfiles "${oldfiles}" --newp "${newroot}/third_party" --newfiles "${newfiles}")
echo "{leafchanges}={${leafchanges}}" >> "$GITHUB_ENV"
- name: Post comment listing YANG leaf changes
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "${{ env.leafchanges }}"
})