CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
checkout-action.ts
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| abfa9ad | 1 | /** |
| 2 | * `gluecron/checkout@v1` — idiomatic no-op. | |
| 3 | * | |
| 4 | * The runner (Agent 5) has already checked out the repo into `ctx.workspace` | |
| 5 | * before any `uses:` step executes. This action exists so users can write | |
| 6 | * the familiar `- uses: gluecron/checkout@v1` line without surprise. It | |
| 7 | * records the resolved commit sha as an output so downstream steps can | |
| 8 | * reference it via `steps.<id>.outputs.sha`. | |
| 9 | */ | |
| 10 | ||
| 11 | import type { ActionHandler } from "../action-registry"; | |
| 12 | ||
| 13 | export const checkoutAction: ActionHandler = { | |
| 14 | name: "gluecron/checkout", | |
| 15 | version: "v1", | |
| 16 | async run(ctx) { | |
| 17 | try { | |
| 18 | const sha = ctx.commitSha || ""; | |
| 19 | return { | |
| 20 | exitCode: 0, | |
| 21 | outputs: { sha }, | |
| 22 | stdout: `Checked out ${sha || "HEAD"} at ${ctx.workspace}`, | |
| 23 | }; | |
| 24 | } catch (err) { | |
| 25 | return { | |
| 26 | exitCode: 1, | |
| 27 | stderr: err instanceof Error ? err.message : String(err), | |
| 28 | }; | |
| 29 | } | |
| 30 | }, | |
| 31 | }; |