According to the documentation
In the event there are no defined check [sic], the fix will always run.
https://oscope-dev.github.io/scope/docs/models/ScopeDoctorGroup#actions
but creating an action without a check results in a schema validation failure
apiVersion: scope.github.com/v1alpha
kind: ScopeDoctorGroup
metadata:
name: mvce
spec:
actions:
- name: always-run
fix:
commands:
- echo 'hello world!'
❯ scope doctor run -v --progress plain
WARN Resource 'ScopeDoctorGroup/mvce' didn't match the schema for ScopeDoctorGroup. "check" is a required property
WARN Could not find any tasks to execute
Summary: 0 groups succeeded
INFO More detailed logs at /tmp/scope/scope-root-20241015-oyOG.log
I tried various other ways of not specifying a check as well.
actions:
- name: always-run
check:
fix:
commands:
- echo 'hello world!'
WARN Resource 'ScopeDoctorGroup/mvce' didn't match the schema for ScopeDoctorGroup. null is not of type "object"
Which led me to this config, which does work as expected.
apiVersion: scope.github.com/v1alpha
kind: ScopeDoctorGroup
metadata:
name: mvce
spec:
actions:
- name: always-run
check: {}
fix:
commands:
- echo 'hello world!'
❯ scope doctor run -v --progress plain
mvce/always-run: hello world!
INFO Fix ran successfully, group: "mvce", name: "always-run"
Summary: 1 groups succeeded
It feels like either check shouldn't be required or the documentation needs to be updated.
According to the documentation
https://oscope-dev.github.io/scope/docs/models/ScopeDoctorGroup#actions
but creating an action without a
checkresults in a schema validation failureI tried various other ways of not specifying a check as well.
WARN Resource 'ScopeDoctorGroup/mvce' didn't match the schema for ScopeDoctorGroup. null is not of type "object"Which led me to this config, which does work as expected.
It feels like either
checkshouldn't be required or the documentation needs to be updated.