{"id":27730052,"url":"https://github.com/koki-develop/ghats","last_synced_at":"2025-05-07T21:07:13.551Z","repository":{"id":284919004,"uuid":"956486515","full_name":"koki-develop/ghats","owner":"koki-develop","description":"GitHub Actions with TypeScript","archived":false,"fork":false,"pushed_at":"2025-05-06T12:02:27.000Z","size":585,"stargazers_count":110,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T21:07:04.774Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ghats","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/koki-develop.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,"zenodo":null}},"created_at":"2025-03-28T10:36:06.000Z","updated_at":"2025-05-06T12:02:29.000Z","dependencies_parsed_at":"2025-04-17T06:30:50.584Z","dependency_job_id":"c43f6985-ce5d-4af5-9c24-17ae3c0776d4","html_url":"https://github.com/koki-develop/ghats","commit_stats":null,"previous_names":["koki-develop/ghats"],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koki-develop%2Fghats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koki-develop%2Fghats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koki-develop%2Fghats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koki-develop%2Fghats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koki-develop","download_url":"https://codeload.github.com/koki-develop/ghats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954415,"owners_count":21830904,"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":[],"created_at":"2025-04-28T05:02:31.469Z","updated_at":"2025-05-07T21:07:13.523Z","avatar_url":"https://github.com/koki-develop.png","language":"TypeScript","readme":"# GitHub Actions with TypeScript\n\n[![NPM Version](https://img.shields.io/npm/v/ghats)](https://www.npmjs.com/package/ghats)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/koki-develop/ghats/release-please.yml)](https://github.com/koki-develop/ghats/actions/workflows/release-please.yml)\n[![codecov](https://codecov.io/gh/koki-develop/ghats/graph/badge.svg?token=M38AAFPXC1)](https://codecov.io/gh/koki-develop/ghats)\n[![GitHub License](https://img.shields.io/github/license/koki-develop/ghats)](./LICENSE)\n\n```ts\n// .github/workflows/hello.ts\nimport { Workflow, Job } from \"ghats\";\n\nconst workflow = new Workflow(\"Hello\", {\n  on: \"push\",\n});\n\nworkflow.addJob(\n  new Job(\"hello\", {\n    runsOn: \"ubuntu-latest\",\n  })\n    .uses(\"actions/checkout@v4\")\n    .run(\"echo 'Hello, world!'\"),\n);\n\nexport default workflow;\n```\n\n## Installation\n\n```console\n$ npm install -D ghats\n```\n\n## Getting Started\n\nCreate workflow in `.github/workflows/*.ts` using the `ghats`.\n\n```ts\n// .github/workflows/hello.ts\nimport { Workflow, Job } from \"ghats\";\n\nconst workflow = new Workflow(\"Hello\", {\n  on: \"push\",\n});\n\nworkflow.addJob(\n  new Job(\"hello\", {\n    runsOn: \"ubuntu-latest\",\n  })\n    .uses(\"actions/checkout@v4\")\n    .run(\"echo 'Hello, world!'\"),\n);\n\nexport default workflow; // NOTE: don't forget this line\n```\n\nRun `ghats build` to build GitHub Actions Workflow files as `.github/workflows/*.yml`.\n\n```console\n$ npx ghats build\n```\n\nThat's all you need to know for basic usage!\n\n### Type Support for Remote Actions\n\nRun the `ghats install` command with the target action specified.\n\n```sh\n$ npx ghats install actions/checkout\n```\n\nThen you can import the `action` function from `ghats`.  \nThe `action` function provides type support for installed actions and their inputs.\n\n```ts\n// .github/workflows/hello.ts\nimport { Workflow, Job, action } from \"ghats\";\n\n// ...\n\nworkflow.addJob(\n  new Job(\"hello\", { /* ... */ })\n    .uses(\n      // ↓↓ Like this! ↓↓\n      action(\"actions/checkout\", {\n        with: { \"persist-credentials\": \"false\" },\n      }),\n    )\n    // ...\n);\n\n// ...\n```\n\n![](./assets/completion.png)\n\nInstalled actions are recorded in `.github/workflows/action.json` and `.github/workflows/actions-lock.json`.\n\n### Files Ignored During Build\n\nBy default, `ghats build` builds all `.github/workflows/*.ts` files, but ignores files that start with `_` (e.g. `.github/workflows/_helpers.ts`).  \nIt's recommended to write common utilities and non-workflow code in these ignored files.\n\n### Configuring GitHub API Token\n\nThe `ghats install` command uses the GitHub API internally.  \nIf you're using remote actions from private repositories or want to pass a GitHub API token to avoid rate limits, set the `GITHUB_TOKEN` environment variable.\n\n```console\n$ GITHUB_TOKEN=\"\u003cYOUR_GITHUB_TOKEN\u003e\" npx ghats install\n```\n\n### Updating `actions.json` and `actions-lock.json` with Renovate\n\nghats records the versions of installed remote actions in `.github/workflows/actions.json` and `.github/workflows/actions-lock.json`.  \nTo automatically update these remote action versions with Renovate, add `\"github\u003ekoki-develop/ghats\"` to the `extends` in your configuration file.\n\n```json5\n// renovate.json\n{\n  \"extends\": [\"github\u003ekoki-develop/ghats\"]\n}\n```\n\n\u003e [!NOTE]\n\u003e Note that after updating `actions.json` and `actions-lock.json`, you need to rebuild your workflows.\n\n## License\n\n[MIT](./LICENSE)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoki-develop%2Fghats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoki-develop%2Fghats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoki-develop%2Fghats/lists"}