Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| g1t has actions of its own: g1t/deploy builds the checkout a job is in and puts it on g1t.page, opening the build with the job's token, masking the build's token and the project's secrets, and running g1t-runner deploy, with the app's url, the deployment's id and its kind as outputs; g1t/detect says what such a build would find (kind, install, build and output-dir) without building anything. Both use the g1t-runner on the machine, or download the newest release from g1t.sh/downloads/runner and check it against its SHA256SUMS. They live under actions/, and the Actions release workflow pushes each folder to its own repository in the g1t workspace and moves its v1 tag whenever main changes them, with the G1T_ACTIONS_PUBLISH_TOKEN secret its header describes. | 1 | # g1t/detect |
| 2 | ||
| 3 | Says what a [g1t.page](https://docs.g1t.sh/guides/deployments/) build of | |
| 4 | the checkout would find, without building or deploying anything: the | |
| 5 | same rules [g1t/deploy](https://g1t.sh/g1t/deploy) builds with. | |
| 6 | ||
| 7 | ```yaml | |
| 8 | steps: | |
| 9 | - uses: actions/checkout@v5 | |
| 10 | - id: detect | |
| 11 | uses: g1t/detect@v1 | |
| 12 | - if: steps.detect.outputs.kind == 'none' | |
| 13 | run: echo "::error::Nothing here would be served." | |
| 14 | - if: steps.detect.outputs.install != '' | |
| 15 | run: ${{ steps.detect.outputs.install }} | |
| 16 | ``` | |
| 17 | ||
| 18 | ## Inputs | |
| 19 | ||
| 20 | | Input | Default | | | |
| 21 | | --- | --- | --- | | |
| 22 | | `root-dir` | The checkout | Where the project is in the checkout. | | |
| 23 | | `build-command` | None | A build command of your own, as `g1t/deploy` takes it. | | |
| 24 | | `output-dir` | None | An output folder of your own, as `g1t/deploy` takes it. | | |
| 25 | ||
| 26 | ## Outputs | |
| 27 | ||
| 28 | | Output | | | |
| 29 | | --- | --- | | |
| 30 | | `kind` | `workers` (a `wrangler.jsonc`, `wrangler.json` or `wrangler.toml`), `static` (a site a build writes), `html` (the files as they are) or `none`. | | |
| 31 | | `install` | How dependencies are installed, from the lockfile: `npm ci`, `pnpm install --frozen-lockfile`, and so on. Empty without a `package.json`. | | |
| 32 | | `build` | What builds it: your command, `npm run build` for a package with a build script, or `wrangler deploy --dry-run` for Workers. Empty when nothing does. | | |
| 33 | | `output-dir` | The folder served, relative to the project (`.` for the project itself): a Workers project's assets directory, or the first of `dist`, `build`, `out`, `public`, `_site`, `.output/public` that exists. Empty when a build has yet to write it. | | |
| 34 | ||
| 35 | It runs `g1t-runner detect`, found or downloaded as `g1t/deploy` finds it. |