mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Bumps the github-actions group with 4 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [actions/cache](https://github.com/actions/cache), [chromaui/action](https://github.com/chromaui/action) and [nix-community/cache-nix-action](https://github.com/nix-community/cache-nix-action). Updates `actions/checkout` from 6.0.1 to 6.0.2 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v6.0.2</h2> <h2>What's Changed</h2> <ul> <li>Add orchestration_id to git user-agent when ACTIONS_ORCHESTRATION_ID is set by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2355">actions/checkout#2355</a></li> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6.0.1...v6.0.2">https://github.com/actions/checkout/compare/v6.0.1...v6.0.2</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v6.0.2</h2> <ul> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <h2>v6.0.1</h2> <ul> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> </ul> <h2>v6.0.0</h2> <ul> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> </ul> <h2>v5.0.1</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <h2>v5.0.0</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> </ul> <h2>v4.3.1</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <h2>v4.3.0</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> <li>Adjust positioning of user email note and permissions heading by <a href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li> <li>Update README.md by <a href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li> <li>Update CODEOWNERS for actions by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li> <li>Update package dependencies by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li> </ul> <h2>v4.2.2</h2> <ul> <li><code>url-helper.ts</code> now leverages well-known environment variables by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li> <li>Expand unit test coverage for <code>isGhes</code> by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li> </ul> <h2>v4.2.1</h2> <ul> <li>Check out other refs/* by commit if provided, fall back to ref by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li> </ul> <h2>v4.2.0</h2> <ul> <li>Add Ref and Commit outputs by <a href="https://github.com/lucacome"><code>@lucacome</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1180">actions/checkout#1180</a></li> <li>Dependency updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>- <a href="https://redirect.github.com/actions/checkout/pull/1777">actions/checkout#1777</a>, <a href="https://redirect.github.com/actions/checkout/pull/1872">actions/checkout#1872</a></li> </ul> <h2>v4.1.7</h2> <ul> <li>Bump the minor-npm-dependencies group across 1 directory with 4 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1739">actions/checkout#1739</a></li> <li>Bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1697">actions/checkout#1697</a></li> <li>Check out other refs/* by commit by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1774">actions/checkout#1774</a></li> <li>Pin actions/checkout's own workflows to a known, good, stable version. by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1776">actions/checkout#1776</a></li> </ul> <h2>v4.1.6</h2> <ul> <li>Check platform to set archive extension appropriately by <a href="https://github.com/cory-miller"><code>@cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1732">actions/checkout#1732</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/checkout/commit/de0fac2e4500dabe0009e67214ff5f5447ce83dd"><code>de0fac2</code></a> Fix tag handling: preserve annotations and explicit fetch-tags (<a href="https://redirect.github.com/actions/checkout/issues/2356">#2356</a>)</li> <li><a href="https://github.com/actions/checkout/commit/064fe7f3312418007dea2b49a19844a9ee378f49"><code>064fe7f</code></a> Add orchestration_id to git user-agent when ACTIONS_ORCHESTRATION_ID is set (...</li> <li>See full diff in <a href="https://github.com/actions/checkout/compare/8e8c483db84b4bee98b60c0593521ed34d9990e8...de0fac2e4500dabe0009e67214ff5f5447ce83dd">compare view</a></li> </ul> </details> <br /> Updates `actions/cache` from 5.0.1 to 5.0.2 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/cache/releases">actions/cache's releases</a>.</em></p> <blockquote> <h2>v.5.0.2</h2> <h1>v5.0.2</h1> <h2>What's Changed</h2> <p>When creating cache entries, 429s returned from the cache service will not be retried.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/cache/blob/main/RELEASES.md">actions/cache's changelog</a>.</em></p> <blockquote> <h1>Releases</h1> <h2>Changelog</h2> <h3>5.0.2</h3> <ul> <li>Bump <code>@actions/cache</code> to v5.0.3 <a href="https://redirect.github.com/actions/cache/pull/1692">#1692</a></li> </ul> <h3>5.0.1</h3> <ul> <li>Update <code>@azure/storage-blob</code> to <code>^12.29.1</code> via <code>@actions/cache@5.0.1</code> <a href="https://redirect.github.com/actions/cache/pull/1685">#1685</a></li> </ul> <h3>5.0.0</h3> <blockquote> <p>[!IMPORTANT] <code>actions/cache@v5</code> runs on the Node.js 24 runtime and requires a minimum Actions Runner version of <code>2.327.1</code>. If you are using self-hosted runners, ensure they are updated before upgrading.</p> </blockquote> <h3>4.3.0</h3> <ul> <li>Bump <code>@actions/cache</code> to <a href="https://redirect.github.com/actions/toolkit/pull/2132">v4.1.0</a></li> </ul> <h3>4.2.4</h3> <ul> <li>Bump <code>@actions/cache</code> to v4.0.5</li> </ul> <h3>4.2.3</h3> <ul> <li>Bump <code>@actions/cache</code> to v4.0.3 (obfuscates SAS token in debug logs for cache entries)</li> </ul> <h3>4.2.2</h3> <ul> <li>Bump <code>@actions/cache</code> to v4.0.2</li> </ul> <h3>4.2.1</h3> <ul> <li>Bump <code>@actions/cache</code> to v4.0.1</li> </ul> <h3>4.2.0</h3> <p>TLDR; The cache backend service has been rewritten from the ground up for improved performance and reliability. <a href="https://github.com/actions/cache">actions/cache</a> now integrates with the new cache service (v2) APIs.</p> <p>The new service will gradually roll out as of <strong>February 1st, 2025</strong>. The legacy service will also be sunset on the same date. Changes in these release are <strong>fully backward compatible</strong>.</p> <p><strong>We are deprecating some versions of this action</strong>. We recommend upgrading to version <code>v4</code> or <code>v3</code> as soon as possible before <strong>February 1st, 2025.</strong> (Upgrade instructions below).</p> <p>If you are using pinned SHAs, please use the SHAs of versions <code>v4.2.0</code> or <code>v3.4.0</code></p> <p>If you do not upgrade, all workflow runs using any of the deprecated <a href="https://github.com/actions/cache">actions/cache</a> will fail.</p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/cache/commit/8b402f58fbc84540c8b491a91e594a4576fec3d7"><code>8b402f5</code></a> Merge pull request <a href="https://redirect.github.com/actions/cache/issues/1692">#1692</a> from GhadimiR/main</li> <li><a href="https://github.com/actions/cache/commit/304ab5a0701ee61908ccb4b5822347949a2e2002"><code>304ab5a</code></a> license for httpclient</li> <li><a href="https://github.com/actions/cache/commit/609fc19e67cd310e97eb36af42355843ffcb35be"><code>609fc19</code></a> Update licensed record for cache</li> <li><a href="https://github.com/actions/cache/commit/b22231e43df11a67538c05e88835f1fa097599c5"><code>b22231e</code></a> Build</li> <li><a href="https://github.com/actions/cache/commit/93150cdfb36a9d84d4e8628c8870bec84aedcf8a"><code>93150cd</code></a> Add PR link to releases</li> <li><a href="https://github.com/actions/cache/commit/9b8ca9f07e012351dafbf1c878e8fe2ee9a01c84"><code>9b8ca9f</code></a> Bump actions/cache to 5.0.3</li> <li>See full diff in <a href="https://github.com/actions/cache/compare/9255dc7a253b0ccc959486e2bca901246202afeb...8b402f58fbc84540c8b491a91e594a4576fec3d7">compare view</a></li> </ul> </details> <br /> Updates `chromaui/action` from 13.3.4 to 13.3.5 <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/chromaui/action/commit/07791f8243f4cb2698bf4d00426baf4b2d1cb7e0"><code>07791f8</code></a> v13.3.5</li> <li>See full diff in <a href="https://github.com/chromaui/action/compare/4c20b95e9d3209ecfdf9cd6aace6bbde71ba1694...07791f8243f4cb2698bf4d00426baf4b2d1cb7e0">compare view</a></li> </ul> </details> <br /> Updates `nix-community/cache-nix-action` from 7.0.0 to 7.0.1 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/nix-community/cache-nix-action/releases">nix-community/cache-nix-action's releases</a>.</em></p> <blockquote> <h2>v7.0.1</h2> <h2>What's Changed</h2> <h2>Fixed</h2> <ul> <li>Checkpoint Nix store database before saving cache by <a href="https://github.com/CathalMullan"><code>@CathalMullan</code></a> in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/278">nix-community/cache-nix-action#278</a></li> <li>Checkpoint Nix store database before copying it by <a href="https://github.com/deemp"><code>@deemp</code></a> in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/279">nix-community/cache-nix-action#279</a></li> </ul> <h2>Fixed (CI)</h2> <ul> <li>Fix formatting in CI by <a href="https://github.com/deemp"><code>@deemp</code></a> in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/280">nix-community/cache-nix-action#280</a></li> <li>Fix workflows for PRs in CI by <a href="https://github.com/deemp"><code>@deemp</code></a> in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/281">nix-community/cache-nix-action#281</a></li> </ul> <h2>Changed (deps)</h2> <!-- raw HTML omitted --> <ul> <li>chore(deps): bump <code>@actions/github</code> from 6.0.1 to 7.0.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/272">nix-community/cache-nix-action#272</a></li> <li>chore(deps-dev): bump eslint-config-love from 140.0.0 to 144.0.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/271">nix-community/cache-nix-action#271</a></li> <li>chore(deps-dev): bump <code>@typescript-eslint/parser</code> from 8.51.0 to 8.52.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/269">nix-community/cache-nix-action#269</a></li> <li>chore(deps-dev): bump eslint-plugin-jest from 29.12.0 to 29.12.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/266">nix-community/cache-nix-action#266</a></li> <li>chore(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 8.51.0 to 8.52.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/268">nix-community/cache-nix-action#268</a></li> <li>chore(deps-dev): bump <code>@typescript-eslint/parser</code> from 8.52.0 to 8.53.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/273">nix-community/cache-nix-action#273</a></li> <li>chore(deps-dev): bump prettier from 3.7.4 to 3.8.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/277">nix-community/cache-nix-action#277</a></li> <li>chore(deps-dev): bump <code>@typescript-eslint/eslint-plugin</code> from 8.52.0 to 8.53.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/274">nix-community/cache-nix-action#274</a></li> </ul> <!-- raw HTML omitted --> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/CathalMullan"><code>@CathalMullan</code></a> made their first contribution in <a href="https://redirect.github.com/nix-community/cache-nix-action/pull/278">nix-community/cache-nix-action#278</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/nix-community/cache-nix-action/compare/v7...v7.0.1">https://github.com/nix-community/cache-nix-action/compare/v7...v7.0.1</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/nix-community/cache-nix-action/commit/106bba72ed8e29c8357661199511ef07790175e9"><code>106bba7</code></a> fix(ci): use a modern command</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/b244431fab1b7abe5a59cdf0a5333321adfc040f"><code>b244431</code></a> chore: update src</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/052bf75174c2526e286675ef224b3ed819ca069b"><code>052bf75</code></a> chore: update docs</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/c19319ee78cf2c8fdae7caec6d618d8d2f103a63"><code>c19319e</code></a> chore: build the action</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/e3b90182d2cfa77237ff1a124c0017402fe96732"><code>e3b9018</code></a> feat(action): add comment about checkpointing after database merging</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/05419d3e13bd8048ce71089f751a60193e8b2520"><code>05419d3</code></a> feat(readme): mention that the action may affect the workflow speed</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/0c043090a02147aa5edf074d1b0b7ccae887fd53"><code>0c04309</code></a> refactor(readme): group limitations and list them in separate sections</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/084a7ec7cc80327648e51c57b90e12b596675f40"><code>084a7ec</code></a> fix(github): adress linter comments and format templates</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/b23f7c961d5d57e86f703e0526f2b35fc9223c12"><code>b23f7c9</code></a> fix(ci): don't fail-fast</li> <li><a href="https://github.com/nix-community/cache-nix-action/commit/6b5a012f6e29cda21881bcb0432a5350d18b44ad"><code>6b5a012</code></a> Merge pull request <a href="https://redirect.github.com/nix-community/cache-nix-action/issues/281">#281</a> from nix-community/fix-prs</li> <li>Additional commits viewable in <a href="https://github.com/nix-community/cache-nix-action/compare/b426b118b6dc86d6952988d396aa7c6b09776d08...106bba72ed8e29c8357661199511ef07790175e9">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
390 lines
15 KiB
YAML
390 lines
15 KiB
YAML
# This workflow checks if a PR requires documentation updates.
|
|
# It creates a Coder Task that uses AI to analyze the PR changes,
|
|
# search existing docs, and comment with recommendations.
|
|
#
|
|
# Triggers:
|
|
# - New PR opened: Initial documentation review
|
|
# - PR updated (synchronize): Re-review after changes
|
|
# - Label "doc-check" added: Manual trigger for review
|
|
# - Workflow dispatch: Manual run with PR URL
|
|
#
|
|
# Note: This workflow requires access to secrets and will be skipped for:
|
|
# - Any PR where secrets are not available
|
|
# For these PRs, maintainers can manually trigger via workflow_dispatch.
|
|
|
|
name: AI Documentation Check
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- labeled
|
|
workflow_dispatch:
|
|
inputs:
|
|
pr_url:
|
|
description: "Pull Request URL to check"
|
|
required: true
|
|
type: string
|
|
template_preset:
|
|
description: "Template preset to use"
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
|
|
jobs:
|
|
doc-check:
|
|
name: Analyze PR for Documentation Updates Needed
|
|
runs-on: ubuntu-latest
|
|
# Run on: opened, synchronize, labeled (with doc-check label), or workflow_dispatch
|
|
# Skip draft PRs unless manually triggered
|
|
if: |
|
|
(
|
|
github.event.action == 'opened' ||
|
|
github.event.action == 'synchronize' ||
|
|
github.event.label.name == 'doc-check' ||
|
|
github.event_name == 'workflow_dispatch'
|
|
) &&
|
|
(github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch')
|
|
timeout-minutes: 30
|
|
env:
|
|
CODER_URL: ${{ secrets.DOC_CHECK_CODER_URL }}
|
|
CODER_SESSION_TOKEN: ${{ secrets.DOC_CHECK_CODER_SESSION_TOKEN }}
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
actions: write
|
|
|
|
steps:
|
|
- name: Check if secrets are available
|
|
id: check-secrets
|
|
env:
|
|
CODER_URL: ${{ secrets.DOC_CHECK_CODER_URL }}
|
|
CODER_TOKEN: ${{ secrets.DOC_CHECK_CODER_SESSION_TOKEN }}
|
|
run: |
|
|
if [[ -z "${CODER_URL}" || -z "${CODER_TOKEN}" ]]; then
|
|
echo "skip=true" >> "${GITHUB_OUTPUT}"
|
|
echo "Secrets not available - skipping doc-check."
|
|
echo "This is expected for PRs where secrets are not available."
|
|
echo "Maintainers can manually trigger via workflow_dispatch if needed."
|
|
{
|
|
echo "⚠️ Workflow skipped: Secrets not available"
|
|
echo ""
|
|
echo "This workflow requires secrets that are unavailable for this run."
|
|
echo "Maintainers can manually trigger via workflow_dispatch if needed."
|
|
} >> "${GITHUB_STEP_SUMMARY}"
|
|
else
|
|
echo "skip=false" >> "${GITHUB_OUTPUT}"
|
|
fi
|
|
|
|
- name: Setup Coder CLI
|
|
if: steps.check-secrets.outputs.skip != 'true'
|
|
uses: coder/setup-action@4a607a8113d4e676e2d7c34caa20a814bc88bfda # v1
|
|
with:
|
|
access_url: ${{ secrets.DOC_CHECK_CODER_URL }}
|
|
coder_session_token: ${{ secrets.DOC_CHECK_CODER_SESSION_TOKEN }}
|
|
|
|
- name: Determine PR Context
|
|
if: steps.check-secrets.outputs.skip != 'true'
|
|
id: determine-context
|
|
env:
|
|
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
GITHUB_EVENT_ACTION: ${{ github.event.action }}
|
|
GITHUB_EVENT_PR_HTML_URL: ${{ github.event.pull_request.html_url }}
|
|
GITHUB_EVENT_PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
INPUTS_PR_URL: ${{ inputs.pr_url }}
|
|
INPUTS_TEMPLATE_PRESET: ${{ inputs.template_preset || '' }}
|
|
run: |
|
|
echo "Using template preset: ${INPUTS_TEMPLATE_PRESET}"
|
|
echo "template_preset=${INPUTS_TEMPLATE_PRESET}" >> "${GITHUB_OUTPUT}"
|
|
|
|
# Determine trigger type for task context
|
|
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
|
|
echo "trigger_type=manual" >> "${GITHUB_OUTPUT}"
|
|
echo "Using PR URL: ${INPUTS_PR_URL}"
|
|
|
|
# Validate PR URL format
|
|
if [[ ! "${INPUTS_PR_URL}" =~ ^https://github\.com/[^/]+/[^/]+/pull/[0-9]+$ ]]; then
|
|
echo "::error::Invalid PR URL format: ${INPUTS_PR_URL}"
|
|
echo "::error::Expected format: https://github.com/owner/repo/pull/NUMBER"
|
|
exit 1
|
|
fi
|
|
|
|
ISSUE_URL="${INPUTS_PR_URL/\/pull\//\/issues\/}"
|
|
echo "pr_url=${ISSUE_URL}" >> "${GITHUB_OUTPUT}"
|
|
PR_NUMBER=$(echo "${INPUTS_PR_URL}" | grep -oP '(?<=pull/)\d+')
|
|
echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}"
|
|
|
|
elif [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
|
|
echo "Using PR URL: ${GITHUB_EVENT_PR_HTML_URL}"
|
|
ISSUE_URL="${GITHUB_EVENT_PR_HTML_URL/\/pull\//\/issues\/}"
|
|
echo "pr_url=${ISSUE_URL}" >> "${GITHUB_OUTPUT}"
|
|
echo "pr_number=${GITHUB_EVENT_PR_NUMBER}" >> "${GITHUB_OUTPUT}"
|
|
|
|
# Set trigger type based on action
|
|
case "${GITHUB_EVENT_ACTION}" in
|
|
opened)
|
|
echo "trigger_type=new_pr" >> "${GITHUB_OUTPUT}"
|
|
;;
|
|
synchronize)
|
|
echo "trigger_type=pr_updated" >> "${GITHUB_OUTPUT}"
|
|
;;
|
|
labeled)
|
|
echo "trigger_type=label_requested" >> "${GITHUB_OUTPUT}"
|
|
;;
|
|
*)
|
|
echo "trigger_type=unknown" >> "${GITHUB_OUTPUT}"
|
|
;;
|
|
esac
|
|
|
|
else
|
|
echo "::error::Unsupported event type: ${GITHUB_EVENT_NAME}"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Build task prompt
|
|
if: steps.check-secrets.outputs.skip != 'true'
|
|
id: extract-context
|
|
env:
|
|
PR_NUMBER: ${{ steps.determine-context.outputs.pr_number }}
|
|
TRIGGER_TYPE: ${{ steps.determine-context.outputs.trigger_type }}
|
|
run: |
|
|
echo "Analyzing PR #${PR_NUMBER} (trigger: ${TRIGGER_TYPE})"
|
|
|
|
# Build context based on trigger type
|
|
case "${TRIGGER_TYPE}" in
|
|
new_pr)
|
|
CONTEXT="This is a NEW PR. Perform a thorough documentation review."
|
|
;;
|
|
pr_updated)
|
|
CONTEXT="This PR was UPDATED with new commits. Only comment if the changes affect documentation needs or address previous feedback."
|
|
;;
|
|
label_requested)
|
|
CONTEXT="A documentation review was REQUESTED via label. Perform a thorough documentation review."
|
|
;;
|
|
manual)
|
|
CONTEXT="This is a MANUAL review request. Perform a thorough documentation review."
|
|
;;
|
|
*)
|
|
CONTEXT="Perform a thorough documentation review."
|
|
;;
|
|
esac
|
|
|
|
# Build task prompt with PR-specific context
|
|
TASK_PROMPT="Use the doc-check skill to review PR #${PR_NUMBER} in coder/coder.
|
|
|
|
${CONTEXT}
|
|
|
|
Use \`gh\` to get PR details, diff, and all comments. Check for previous doc-check comments (from coder-doc-check) and only post a new comment if it adds value.
|
|
|
|
## Comment format
|
|
|
|
Use this structure (only include relevant sections):
|
|
|
|
\`\`\`
|
|
## Documentation Check
|
|
|
|
### Previous Feedback
|
|
[For re-reviews only: Addressed | Partially addressed | Not yet addressed]
|
|
|
|
### Updates Needed
|
|
- [ ] \`docs/path/file.md\` - [what needs to change]
|
|
|
|
### New Documentation Needed
|
|
- [ ] \`docs/suggested/path.md\` - [what should be documented]
|
|
|
|
### No Changes Needed
|
|
[brief explanation - use this OR the above sections, not both]
|
|
|
|
---
|
|
*Automated review via [Coder Tasks](https://coder.com/docs/ai-coder/tasks)*
|
|
\`\`\`"
|
|
|
|
# Output the prompt
|
|
{
|
|
echo "task_prompt<<EOFOUTPUT"
|
|
echo "${TASK_PROMPT}"
|
|
echo "EOFOUTPUT"
|
|
} >> "${GITHUB_OUTPUT}"
|
|
|
|
- name: Checkout create-task-action
|
|
if: steps.check-secrets.outputs.skip != 'true'
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 1
|
|
path: ./.github/actions/create-task-action
|
|
persist-credentials: false
|
|
ref: main
|
|
repository: coder/create-task-action
|
|
|
|
- name: Create Coder Task for Documentation Check
|
|
if: steps.check-secrets.outputs.skip != 'true'
|
|
id: create_task
|
|
uses: ./.github/actions/create-task-action
|
|
with:
|
|
coder-url: ${{ secrets.DOC_CHECK_CODER_URL }}
|
|
coder-token: ${{ secrets.DOC_CHECK_CODER_SESSION_TOKEN }}
|
|
coder-organization: "default"
|
|
coder-template-name: coder-workflow-bot
|
|
coder-template-preset: ${{ steps.determine-context.outputs.template_preset }}
|
|
coder-task-name-prefix: doc-check
|
|
coder-task-prompt: ${{ steps.extract-context.outputs.task_prompt }}
|
|
coder-username: doc-check-bot
|
|
github-token: ${{ github.token }}
|
|
github-issue-url: ${{ steps.determine-context.outputs.pr_url }}
|
|
comment-on-issue: true
|
|
|
|
- name: Write Task Info
|
|
if: steps.check-secrets.outputs.skip != 'true'
|
|
env:
|
|
TASK_CREATED: ${{ steps.create_task.outputs.task-created }}
|
|
TASK_NAME: ${{ steps.create_task.outputs.task-name }}
|
|
TASK_URL: ${{ steps.create_task.outputs.task-url }}
|
|
PR_URL: ${{ steps.determine-context.outputs.pr_url }}
|
|
run: |
|
|
{
|
|
echo "## Documentation Check Task"
|
|
echo ""
|
|
echo "**PR:** ${PR_URL}"
|
|
echo "**Task created:** ${TASK_CREATED}"
|
|
echo "**Task name:** ${TASK_NAME}"
|
|
echo "**Task URL:** ${TASK_URL}"
|
|
echo ""
|
|
} >> "${GITHUB_STEP_SUMMARY}"
|
|
|
|
- name: Wait for Task Completion
|
|
if: steps.check-secrets.outputs.skip != 'true'
|
|
id: wait_task
|
|
env:
|
|
TASK_NAME: ${{ steps.create_task.outputs.task-name }}
|
|
run: |
|
|
echo "Waiting for task to complete..."
|
|
echo "Task name: ${TASK_NAME}"
|
|
|
|
if [[ -z "${TASK_NAME}" ]]; then
|
|
echo "::error::TASK_NAME is empty"
|
|
exit 1
|
|
fi
|
|
|
|
MAX_WAIT=600 # 10 minutes
|
|
WAITED=0
|
|
POLL_INTERVAL=3
|
|
LAST_STATUS=""
|
|
|
|
is_workspace_message() {
|
|
local msg="$1"
|
|
[[ -z "$msg" ]] && return 0 # Empty = treat as workspace/startup
|
|
[[ "$msg" =~ ^Workspace ]] && return 0
|
|
[[ "$msg" =~ ^Agent ]] && return 0
|
|
return 1
|
|
}
|
|
|
|
while [[ $WAITED -lt $MAX_WAIT ]]; do
|
|
# Get task status (|| true prevents set -e from exiting on non-zero)
|
|
RAW_OUTPUT=$(coder task status "${TASK_NAME}" -o json 2>&1) || true
|
|
STATUS_JSON=$(echo "$RAW_OUTPUT" | grep -v "^version mismatch\|^download v" || true)
|
|
|
|
# Debug: show first poll's raw output
|
|
if [[ $WAITED -eq 0 ]]; then
|
|
echo "Raw status output: ${RAW_OUTPUT:0:500}"
|
|
fi
|
|
|
|
if [[ -z "$STATUS_JSON" ]] || ! echo "$STATUS_JSON" | jq -e . >/dev/null 2>&1; then
|
|
if [[ "$LAST_STATUS" != "waiting" ]]; then
|
|
echo "[${WAITED}s] Waiting for task status..."
|
|
LAST_STATUS="waiting"
|
|
fi
|
|
sleep $POLL_INTERVAL
|
|
WAITED=$((WAITED + POLL_INTERVAL))
|
|
continue
|
|
fi
|
|
|
|
TASK_STATE=$(echo "$STATUS_JSON" | jq -r '.current_state.state // "unknown"')
|
|
TASK_MESSAGE=$(echo "$STATUS_JSON" | jq -r '.current_state.message // ""')
|
|
WORKSPACE_STATUS=$(echo "$STATUS_JSON" | jq -r '.workspace_status // "unknown"')
|
|
|
|
# Build current status string for comparison
|
|
CURRENT_STATUS="${TASK_STATE}|${WORKSPACE_STATUS}|${TASK_MESSAGE}"
|
|
|
|
# Only log if status changed
|
|
if [[ "$CURRENT_STATUS" != "$LAST_STATUS" ]]; then
|
|
if [[ "$TASK_STATE" == "idle" ]] && is_workspace_message "$TASK_MESSAGE"; then
|
|
echo "[${WAITED}s] Workspace ready, waiting for Agent..."
|
|
else
|
|
echo "[${WAITED}s] State: ${TASK_STATE} | Workspace: ${WORKSPACE_STATUS} | ${TASK_MESSAGE}"
|
|
fi
|
|
LAST_STATUS="$CURRENT_STATUS"
|
|
fi
|
|
|
|
if [[ "$WORKSPACE_STATUS" == "failed" || "$WORKSPACE_STATUS" == "canceled" ]]; then
|
|
echo "::error::Workspace failed: ${WORKSPACE_STATUS}"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "$TASK_STATE" == "idle" ]]; then
|
|
if ! is_workspace_message "$TASK_MESSAGE"; then
|
|
# Real completion message from Claude!
|
|
echo ""
|
|
echo "Task completed: ${TASK_MESSAGE}"
|
|
RESULT_URI=$(echo "$STATUS_JSON" | jq -r '.current_state.uri // ""')
|
|
echo "result_uri=${RESULT_URI}" >> "${GITHUB_OUTPUT}"
|
|
echo "task_message=${TASK_MESSAGE}" >> "${GITHUB_OUTPUT}"
|
|
break
|
|
fi
|
|
fi
|
|
|
|
sleep $POLL_INTERVAL
|
|
WAITED=$((WAITED + POLL_INTERVAL))
|
|
done
|
|
|
|
if [[ $WAITED -ge $MAX_WAIT ]]; then
|
|
echo "::error::Task monitoring timed out after ${MAX_WAIT}s"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Fetch Task Logs
|
|
if: always() && steps.check-secrets.outputs.skip != 'true'
|
|
env:
|
|
TASK_NAME: ${{ steps.create_task.outputs.task-name }}
|
|
run: |
|
|
echo "::group::Task Conversation Log"
|
|
if [[ -n "${TASK_NAME}" ]]; then
|
|
coder task logs "${TASK_NAME}" 2>&1 || echo "Failed to fetch logs"
|
|
else
|
|
echo "No task name, skipping log fetch"
|
|
fi
|
|
echo "::endgroup::"
|
|
|
|
- name: Cleanup Task
|
|
if: always() && steps.check-secrets.outputs.skip != 'true'
|
|
env:
|
|
TASK_NAME: ${{ steps.create_task.outputs.task-name }}
|
|
run: |
|
|
if [[ -n "${TASK_NAME}" ]]; then
|
|
echo "Deleting task: ${TASK_NAME}"
|
|
coder task delete "${TASK_NAME}" -y 2>&1 || echo "Task deletion failed or already deleted"
|
|
else
|
|
echo "No task name, skipping cleanup"
|
|
fi
|
|
|
|
- name: Write Final Summary
|
|
if: always() && steps.check-secrets.outputs.skip != 'true'
|
|
env:
|
|
TASK_NAME: ${{ steps.create_task.outputs.task-name }}
|
|
TASK_MESSAGE: ${{ steps.wait_task.outputs.task_message }}
|
|
RESULT_URI: ${{ steps.wait_task.outputs.result_uri }}
|
|
PR_NUMBER: ${{ steps.determine-context.outputs.pr_number }}
|
|
run: |
|
|
{
|
|
echo ""
|
|
echo "---"
|
|
echo "### Result"
|
|
echo ""
|
|
echo "**Status:** ${TASK_MESSAGE:-Task completed}"
|
|
if [[ -n "${RESULT_URI}" ]]; then
|
|
echo "**Comment:** ${RESULT_URI}"
|
|
fi
|
|
echo ""
|
|
echo "Task \`${TASK_NAME}\` has been cleaned up."
|
|
} >> "${GITHUB_STEP_SUMMARY}"
|