Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/test-breaking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,13 @@ jobs:
# jq stays the system jq; only oasdiff and curl are stubbed.
export PATH=/tmp/stub:$PATH

./breaking/entrypoint.sh 'specs/base.yaml' 'specs/revision-breaking.yaml' \
'' '' 'false' '' '' '' '' 'false' 'false' '' '' '' 'false' 'true' 'fake-token'
# bash, not the script's own sh: on the runner that is dash, which drops
# environment variables whose names have a hyphen (INPUT_GITHUB-TOKEN).
# The action's container runs busybox ash, which keeps them.
env OASDIFF_ACTION_COMMAND=breaking \
INPUT_BASE=specs/base.yaml INPUT_REVISION=specs/revision-breaking.yaml \
INPUT_COMPOSED=false 'INPUT_ALLOW-EXTERNAL-REFS=false' INPUT_REVIEW=true \
'INPUT_GITHUB-TOKEN=fake-token' bash ./breaking/entrypoint.sh

if [ ! -f /tmp/run/comment.json ]; then
echo "FAIL: no comment was posted" >&2
Expand Down Expand Up @@ -514,8 +519,10 @@ jobs:
export PATH=/tmp/stub:$PATH

run_entrypoint () {
./breaking/entrypoint.sh 'specs/base.yaml' 'specs/revision-breaking.yaml' \
'' '' 'false' '' '' '' '' 'false' 'false' '' '' '' 'false' 'true' 'fake-token'
env OASDIFF_ACTION_COMMAND=breaking \
INPUT_BASE=specs/base.yaml INPUT_REVISION=specs/revision-breaking.yaml \
INPUT_COMPOSED=false 'INPUT_ALLOW-EXTERNAL-REFS=false' INPUT_REVIEW=true \
'INPUT_GITHUB-TOKEN=fake-token' bash ./breaking/entrypoint.sh
}

echo "=== same-repo pull request: expect a warning naming the permission"
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ jobs:

export PATH=/tmp/stub:$PATH
set +e
out=$(./changelog/entrypoint.sh \
'b' 'r' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' 'stub-oasdiff-token' 2>&1)
out=$(env OASDIFF_ACTION_COMMAND=changelog INPUT_BASE=b INPUT_REVISION=r \
'INPUT_OASDIFF-TOKEN=stub-oasdiff-token' bash ./breaking/entrypoint.sh 2>&1)
rc=$?
set -e
echo "--- entrypoint output ---"; echo "$out"
Expand Down Expand Up @@ -221,8 +221,8 @@ jobs:

export PATH=/tmp/stub:$PATH
set +e
out=$(./changelog/entrypoint.sh \
'b' 'r' '' '' '' '' '' '' '' '' '' '' '' '' '' '' 'gh-token' 'oasdiff-token' 2>&1)
out=$(env OASDIFF_ACTION_COMMAND=changelog INPUT_BASE=b INPUT_REVISION=r \
'INPUT_GITHUB-TOKEN=gh-token' 'INPUT_OASDIFF-TOKEN=oasdiff-token' bash ./breaking/entrypoint.sh 2>&1)
rc=$?
set -e
echo "--- output ---"; echo "$out"
Expand Down Expand Up @@ -325,8 +325,10 @@ jobs:
export GITHUB_EVENT_PATH=/tmp/run/event.json
export PATH=/tmp/stub:$PATH

./changelog/entrypoint.sh 'specs/base.yaml' 'specs/revision.yaml' \
'false' '' '' 'false' 'false' '' '' '' 'false' '' '' '' 'false' 'true' 'fake-token' ''
env OASDIFF_ACTION_COMMAND=changelog \
INPUT_BASE=specs/base.yaml INPUT_REVISION=specs/revision.yaml \
INPUT_COMPOSED=false 'INPUT_ALLOW-EXTERNAL-REFS=false' INPUT_REVIEW=true \
'INPUT_GITHUB-TOKEN=fake-token' bash ./breaking/entrypoint.sh

if [ ! -f /tmp/run/comment.json ]; then
echo "FAIL: no comment was posted" >&2
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test-error-annotation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ jobs:
export STUB_CODE="$1" STUB_STDERR="$2"; cmd="$3"
: > "$GITHUB_OUTPUT"; : > "$GITHUB_STEP_SUMMARY"
case "$cmd" in
breaking) sh breaking/entrypoint.sh base.yaml rev.yaml "" "" "" "" "" "" "" "" "" "" "" "" "false" ;;
changelog) sh changelog/entrypoint.sh base.yaml rev.yaml "" "" "" "" "" "" "" "" "" "" "" "" "false" ;;
# bash, not sh: the runner's sh is dash, which drops environment
# variables whose names have a hyphen, as INPUT_ALLOW-EXTERNAL-REFS
# does. The action's container runs busybox ash, which keeps them.
breaking|changelog)
env OASDIFF_ACTION_COMMAND="$cmd" INPUT_BASE=base.yaml INPUT_REVISION=rev.yaml \
'INPUT_ALLOW-EXTERNAL-REFS=false' bash breaking/entrypoint.sh ;;
diff) sh diff/entrypoint.sh base.yaml rev.yaml "" "" "" "" "" "" "" "false" ;;
pr-comment) sh pr-comment/entrypoint.sh base.yaml rev.yaml "" "" "" "" "" "" "false" ;;
validate) sh validate/entrypoint.sh spec.yaml "" "false" ;;
Expand Down
20 changes: 2 additions & 18 deletions breaking/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,5 @@ outputs:
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.base }}
- ${{ inputs.revision }}
- ${{ inputs.fail-on }}
- ${{ inputs.include-checks }}
- ${{ inputs.include-path-params }}
- ${{ inputs.deprecation-days-beta }}
- ${{ inputs.deprecation-days-stable }}
- ${{ inputs.exclude-elements }}
- ${{ inputs.filter-extension }}
- ${{ inputs.composed }}
- ${{ inputs.flatten-allof }}
- ${{ inputs.err-ignore }}
- ${{ inputs.warn-ignore }}
- ${{ inputs.output-to-file }}
- ${{ inputs.allow-external-refs }}
- ${{ inputs.review }}
- ${{ inputs.github-token }}
env:
OASDIFF_ACTION_COMMAND: breaking
Loading
Loading