Skip to content

[breaking] Align 'fail-on-diff' with oasdiff 'fail-on' #273

[breaking] Align 'fail-on-diff' with oasdiff 'fail-on'

[breaking] Align 'fail-on-diff' with oasdiff 'fail-on' #273

Workflow file for this run

name: 'Test oasdiff actions'
on:
pull_request:
push:
jobs:
oasdiff_breaking:
runs-on: ubuntu-latest
name: Test breaking changes
steps:
- name: checkout
uses: actions/checkout@v4
- name: Running breaking action
id: test_breaking_changes
uses: ./breaking
with:
base: 'specs/base.yaml'
revision: 'specs/revision-breaking-warn.yaml'
output-to-file: 'breaking.txt'
fail-on: 'WARN'
- name: Test breaking changes action output
run: |
delimiter=$(cat /proc/sys/kernel/random/uuid | tr -d '-')
output=$(cat <<-$delimiter
${{ steps.test_breaking_changes.outputs.breaking }}
$delimiter
)
if [ "$output" != "1 breaking changes: 1 error, 0 warning" ]; then
echo "Expected output '1 breaking changes: 1 error, 0 warning' but got '$output'" >&2
exit 1
fi
- name: Test breaking changes action output to file
run: |
if [ ! -s breaking.txt ]; then
echo "Breaking changes file doesn't exist or is empty"
exit 1
fi
output=$(cat breaking.txt | head -n 1)
if [[ "${output}" != "1 breaking changes: 1 error, 0 warning" ]]; then
echo "Expected output '1 breaking changes: 1 error, 0 warning' but got '${output}'" >&2
exit 1
fi