mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
338b952d71
This pull request updates the `.github/workflows/doc-check.yaml` workflow to improve its handling of required secrets. The workflow now checks for the presence of necessary secrets before proceeding, and conditionally skips all subsequent steps if the secrets are unavailable. This prevents failures on pull requests where secrets are not accessible (such as from forks), and provides clear messaging for maintainers about manual triggering options. Key improvements: **Secret availability checks and conditional execution:** * Added an explicit step at the start of the workflow to check if required secrets (`DOC_CHECK_CODER_URL` and `DOC_CHECK_CODER_SESSION_TOKEN`) are available, and set an output flag (`skip`) accordingly. * Updated all subsequent workflow steps to include a conditional (`if: steps.check-secrets.outputs.skip != 'true'`), ensuring they only run if the secrets are present. This includes setup, context extraction, task creation, waiting, and summary steps. [[1]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149R59-R82) [[2]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149R140) [[3]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149R205) [[4]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149R215) [[5]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149R232) [[6]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149R250) * Modified the "Fetch Task Logs", "Cleanup Task", and "Write Final Summary" steps to combine their existing `always()` condition with the new secrets check, preventing unnecessary errors when secrets are missing. [[1]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149L314-R340) [[2]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149L327-R353) [[3]](diffhunk://#diff-46e6065a312f35e5d294476e7865089afd10e6072fed80ac77b257e090def149L339-R365) **Documentation and messaging:** * Added comments at the top of the workflow file to explain the secret requirements and the expected behavior for PRs without secrets, including instructions for maintainers on manual triggering.…se on pr's originating from forks. <!-- If you have used AI to produce some or all of this PR, please ensure you have read our [AI Contribution guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING) before submitting. -->