Skip to content

test WARN

test WARN #288

Workflow file for this run

name: 'Test oasdiff actions'
on:
pull_request:
push:
jobs:
oasdiff_breaking_fail_on:
runs-on: ubuntu-latest
name: Test fail on 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" != "2 breaking changes: 0 error, 2 warning" ]; then
echo "Expected output '2 breaking changes: 0 error, 2 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}" != "2 breaking changes: 0 error, 2 warning" ]]; then
echo "Expected output '2 breaking changes: 0 error, 2 warning' but got '${output}'" >&2
exit 1
fi