sync-test: skip when required connector secret is empty#83
Open
robert-chiniquy wants to merge 1 commit into
Open
sync-test: skip when required connector secret is empty#83robert-chiniquy wants to merge 1 commit into
robert-chiniquy wants to merge 1 commit into
Conversation
Add an optional 'required-secrets' input listing env var names that must be
non-empty for the test to run. If any are empty the action logs a skip
notice and exits 0 instead of failing on a missing-credential side effect
(empty grants, jq exit-status failure, etc.).
Connectors opt in by setting the input in their workflow:
- uses: ConductorOne/github-workflows/actions/sync-test@v3
with:
connector: ./baton-foo
baton-entitlement: 'role:owner:assigned'
baton-principal: 'user@example.com'
required-secrets: BATON_FOO_TOKEN
Existing callers (no new input) behave exactly as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
About two dozen connector testability PRs across the baton-* repos are stuck on the shared
sync-testaction. The action calls the connector binary, then usesbaton grants+ ajq --exit-statusfilter to assert a specific test grant exists.When the connector's credentials env var isn't populated — because the org secret hasn't been provisioned for that repo yet, or the workflow ran from a fork — the binary runs but returns no grants, the jq filter exits non-zero, and the job fails. The PR author can't fix that from the code side, so the testability PRs sit indefinitely.
What this does
Adds an optional
required-secretsinput toactions/sync-test. It takes a comma- or whitespace-separated list of env var names. If any are empty whengrant-revoke.shstarts, the action logs an::notice::and exits 0 instead of running the test.Existing callers with no
required-secretsinput behave exactly as before.Test plan
required-secretsand confirm the test job skips cleanly with the credentials secret unset, and still runs when set.Follow-ups (out of scope for this PR)
--base-urlflag from the connector testability project — this PR just unblocks the queue in the meantime.