{"id":15755933,"url":"https://github.com/simenandre/actions-parsers","last_synced_at":"2025-10-07T15:06:57.814Z","repository":{"id":69280904,"uuid":"582765968","full_name":"simenandre/actions-parsers","owner":"simenandre","description":"Upgrade inputs from `@actions/core` by parsing and extended types!","archived":false,"fork":false,"pushed_at":"2025-04-15T23:56:01.000Z","size":7028,"stargazers_count":0,"open_issues_count":23,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-03T06:05:08.253Z","etag":null,"topics":["actions","github-actions","parser","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simenandre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-12-27T20:07:52.000Z","updated_at":"2023-04-21T20:36:20.000Z","dependencies_parsed_at":"2023-11-30T03:27:24.105Z","dependency_job_id":"3e77c4e5-a24c-4ccc-a81c-c791e3c4d180","html_url":"https://github.com/simenandre/actions-parsers","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simenandre%2Factions-parsers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simenandre%2Factions-parsers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simenandre%2Factions-parsers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simenandre%2Factions-parsers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simenandre","download_url":"https://codeload.github.com/simenandre/actions-parsers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252845949,"owners_count":21813345,"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":["actions","github-actions","parser","typescript"],"created_at":"2024-10-04T08:41:10.094Z","updated_at":"2025-10-07T15:06:57.808Z","avatar_url":"https://github.com/simenandre.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github Action Parsers\n\nThis library tries to improve building actions for Github Actions using\nTypescript. It might be a bit opinionated, but I feel it's important to make\nsure inputs are validated and type-safe.\n\nThere are some ease-of-life added features here:\n\n- Input functions that can easily be tied with Runtypes / Zod.\n- Parser for union, number and literal inputs\n- Parser for YAML\n\nAnother big thing is that this package re-exports all input-related functions in\n`@actions/core` with improved types.\n\nTo learn more, check out this issue:\nhttps://github.com/actions/toolkit/issues/1290\n\n## Quickstart\n\n```shell\nyarn add actions-parsers @actions/core\n```\n\n## Example\n\n```typescript\nimport * as parsers from 'actions-parsers';\n\nexport const config = {\n\n  /**\n   * Functions from `@actions/core`:\n   **/\n\n  simpleString: parsers.getInput('simple-string'),\n  // 👆 Type is string or undefined\n\n  simpleRequiredString: parsers.getInput('simple-required-string', { required: true }),\n  // 👆 Type is string or undefined\n\n  multilineString: parsers.getMultilineInput('multiline', { required: true }).\n  // 👆 Type is string[]\n\n  aNumericValue: parsers.getNumber('a-numeric-value'),\n  // 👆 Type is number or undefined.\n\n  type: parsers.getUnion('type', { alternatives: ['one', 'two'] as const }),\n  // 👆 Type is \"one\" | \"two\" | undefined\n\n  literal: parsers.getLiteral('literal', { requiredValue: 'hello-world' }),\n  // 👆 Type is \"hello-world\" | undefined\n}\n```\n\nIf combined with Runtypes, Zod or any other runtime validation for static types\ncan get parsed type-safe YAML, for example like this:\n\n```typescript\nimport { getYAMLInput } from 'actions-parsers';\nimport * as rt from 'runtypes';\n\nconst inputFieldRt = rt.Record({\n  firstKey: rt.String,\n  literal: rt.Literal('hello-world'),\n  anArrayOfObject: rt.Array(\n    rt.Record({\n      key: rt.String,\n      value: rt.String,\n    }),\n  ),\n});\n\nexport const yamlValue = getYAMLInput('input-field', {\n  parser: value =\u003e inputFieldRt.check(value),\n});\n```\n\nThis is also possible to do the same with `getParsedInput`, like this:\n\n```typescript\nimport { getParsedInput } from 'actions-parsers';\nimport { z } from 'zod';\n\nconst aDateFieldZod = z\n  .date()\n  .min(new Date('1900-01-01'), { message: 'Too old' })\n  .max(new Date(), { message: 'Too young!' });\n\nexport const aDateField = getParsedInput('a-field', {\n  parser: value =\u003e aDateFieldZod.parse(value),\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimenandre%2Factions-parsers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimenandre%2Factions-parsers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimenandre%2Factions-parsers/lists"}