{"id":23631852,"url":"https://github.com/jpb06/effect-action","last_synced_at":"2026-05-04T13:31:56.955Z","repository":{"id":267530862,"uuid":"901521637","full_name":"jpb06/effect-action","owner":"jpb06","description":"A template to create a github action relying on effect, with pretty errors reporting","archived":false,"fork":false,"pushed_at":"2025-02-16T16:22:39.000Z","size":3878,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T17:33:01.393Z","etag":null,"topics":["effect-ts","github-actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpb06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-10T20:13:03.000Z","updated_at":"2025-02-16T16:22:40.000Z","dependencies_parsed_at":"2025-02-16T17:26:48.650Z","dependency_job_id":"c9e18f5c-9f69-4606-ac81-2438a09af6ef","html_url":"https://github.com/jpb06/effect-action","commit_stats":null,"previous_names":["jpb06/effect-action"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Feffect-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Feffect-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Feffect-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpb06%2Feffect-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpb06","download_url":"https://codeload.github.com/jpb06/effect-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239558737,"owners_count":19658925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["effect-ts","github-actions"],"created_at":"2024-12-28T03:18:44.842Z","updated_at":"2026-05-04T13:31:56.949Z","avatar_url":"https://github.com/jpb06.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# effect-action\n\n[![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode\u0026label=\u0026message=Open%20in%20Visual%20Studio%20Code\u0026labelColor=2c2c32\u0026color=007acc\u0026logoColor=007acc)](https://github.dev/jpb06/effect-action)\n\nA template to create a github action using [Effect](https://effect.website/) and [effect-errors](https://github.com/jpb06/effect-errors).\n\n\u003c!-- readme-package-icons start --\u003e\n\n\u003cp align=\"left\"\u003e\u003ca href=\"https://docs.github.com/en/actions\" target=\"_blank\"\u003e\u003cimg height=\"50\" width=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/GithubActions-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://www.typescriptlang.org/docs/\" target=\"_blank\"\u003e\u003cimg height=\"50\" width=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/TypeScript.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://nodejs.org/en/docs/\" target=\"_blank\"\u003e\u003cimg height=\"50\" width=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/NodeJS-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://bun.sh/docs\" target=\"_blank\"\u003e\u003cimg height=\"50\" width=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Bun-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://biomejs.dev/guides/getting-started/\" target=\"_blank\"\u003e\u003cimg height=\"50\" width=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Biome-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://esbuild.github.io/getting-started/#install-esbuild\" target=\"_blank\"\u003e\u003cimg height=\"50\" width=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Esbuild-Dark.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://www.effect.website/docs/quickstart\" target=\"_blank\"\u003e\u003cimg height=\"50\" width=\"50\" src=\"https://raw.githubusercontent.com/jpb06/jpb06/master/icons/Effect-Dark.svg\" /\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003c!-- readme-package-icons end --\u003e\n\n## ⚡ Output\n\n![example](./docs/workflow-run-example.png)\n\nYou can take a look at the three sample workflows:\n\n- [Success](https://github.com/jpb06/effect-action/actions/workflows/success.yml).\n- [Main task failure](https://github.com/jpb06/effect-action/actions/workflows/main-task-failure.yml).\n- [Sub task failure](https://github.com/jpb06/effect-action/actions/workflows/sub-task-failure.yml).\n\n## ⚡ Usage\n\nTo pretty print the error and display a stack trace that is actually useful, we must collect the `cause` using `Effect.catchAll` and use `captureErrors` from [effect-errors](https://github.com/jpb06/effect-errors).\n\nThis function will use source maps if present to resolve sources location. We can then use `prettyPrintFromCapturedErrors` function to display the error details.\n\n```ts\nimport { setFailed } from '@actions/core';\nimport { FetchHttpClient } from '@effect/platform';\nimport { NodeFileSystem } from '@effect/platform-node';\nimport { Effect, Layer, pipe } from 'effect';\nimport { captureErrors, prettyPrintFromCapturedErrors } from 'effect-errors';\nimport type { Cause } from 'effect/Cause';\n\nconst collectErrorDetails = \u003cE\u003e(cause: Cause\u003cE\u003e) =\u003e\n  pipe(\n    Effect.gen(function* () {\n      const captured = yield* captureErrors(cause, {\n        reverseSpans: true,\n        stripCwd: true,\n      });\n      const message = prettyPrintFromCapturedErrors(captured, {\n        hideStackTrace: true,\n        stripCwd: true,\n        reverseSpans: true,\n      });\n\n      console.error(message);\n\n      setFailed('❌ Github action workflow failure');\n    }),\n    Effect.scoped,\n    Effect.provide(Layer.mergeAll(FetchHttpClient.layer, NodeFileSystem.layer)),\n    Effect.withSpan('collect-error-details')\n  );\n\nexport const actionWorkflow = Effect.runPromise(\n  pipe(\n    starter,\n    Effect.sandbox,\n    Effect.catchAll(collectErrorDetails),\n    Effect.provide(LoggerConsoleLive),\n    Effect.withSpan('action-workflow')\n  )\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpb06%2Feffect-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpb06%2Feffect-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpb06%2Feffect-action/lists"}