File tree Expand file tree Collapse file tree 6 files changed +0
-242
lines changed Expand file tree Collapse file tree 6 files changed +0
-242
lines changed Original file line number Diff line number Diff line change @@ -134,34 +134,3 @@ jobs:
134134 echo "Action should have failed with codelists error"
135135 exit 1
136136 fi
137-
138- test-check :
139- runs-on : ubuntu-20.04
140- name : Test dataset check failure
141- steps :
142- - name : Checkout
143- uses : actions/checkout@v4
144- - name : Test project with failing codelists check
145- uses : ./
146- id : dataset
147- continue-on-error : true
148- with :
149- directory : tests/dataset
150- users : ' @nobody'
151- - name : Assert check failed and created issue
152- env :
153- ISSUE_URL : ${{ steps.dataset.outputs.issue }}
154- run : |
155- fail() {
156- echo "$@"
157- exit 1
158- }
159- cleanup() {
160- gh issue close "$ISSUE_URL" || true
161- }
162- trap cleanup EXIT
163- test "${{ steps.dataset.outcome }}" = "failure" || fail "Action should have failed with dataset error"
164- test -n "$ISSUE_URL" || fail "No issue url output from dataset step"
165- gh issue view "$ISSUE_URL" || fail "Could not view issue at $ISSUE_URL"
166-
167-
Original file line number Diff line number Diff line change 66 description : " Directory containing OpenSAFELY project"
77 required : false
88 default : .
9- users :
10- description : " @names of users who should be notified on dataset failure"
11- required : false
12- default : " @amirmehrkar @JulietUnderdown1 @LiamHart-hub @alexwalkerepi"
139 actions :
1410 description : " Names of project actions to run during tests (default 'run_all')"
1511 required : false
3228 shell : bash
3329 working-directory : ${{ inputs.directory }}
3430 run : opensafely codelists check
35- - name : Check datasets
36- shell : bash
37- id : datasets
38- working-directory : ${{ inputs.directory }}
39- run : |
40- success=true
41- OUTPUT=$(opensafely check 2>&1) || success=false
42- echo "$OUTPUT"
43- # exit early if we're all good
44- test "$success" = "true" && exit 0
45-
46- BODY=$(cat << EOF
47- Dataset check for $GITHUB_REPOSITORY at $GITHUB_SHA:
48- \`\`\`
49- $OUTPUT
50- \`\`\`
51- ${{ inputs.users }}
52- EOF
53- )
54-
55- ISSUE_URL=$(gh issue create --title "Dataset check fail" --body "$BODY")
56-
57- echo "Created issue at $ISSUE_URL"
58- echo "::set-output name=issue::$ISSUE_URL"
59- exit 1
6031 - name : Run project
6132 shell : bash
6233 working-directory : ${{ inputs.directory }}
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments