Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/actions-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"actions": {
"actions/[email protected]": "5a3ec84eff668545956fd18022155c47e93e2684",
"actions/[email protected]": "11bd71901bbe5b1630ceea73d27597364c9af683",
"codecov/[email protected]": "0565863a31f2c772f9f0395002a31e3f06189574",
"googleapis/[email protected]": "a02a34c4d625f9be7cb89156071d8567266a2445",
"jdx/[email protected]": "5083fe46898c414b2475087cc79da59e7da859e8",
"koki-develop/github-actions-lint/[email protected]": "cd40a2834e54895146e4a73ae17dcc37944ffb0f",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/actions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"actions/cache": "v4.2.3",
"actions/checkout": "v4.2.2",
"codecov/codecov-action": "v5.4.0",
"googleapis/release-please-action": "v4.2.0",
"jdx/mise-action": "v2.1.11",
"koki-develop/github-actions-lint/actionlint": "v1.1.0",
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/ci.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Workflow } from "ghats";
import { action, Workflow } from "ghats";
import { setupJob } from "./_helpers";

const workflow = new Workflow("CI", {
Expand All @@ -14,7 +14,18 @@ workflow.addJob(
permissions: { contents: "read" },
timeoutMinutes: 5,
withBun: true,
}).run("bun test"),
})
.run("bun test --coverage --coverage-reporter=lcov")
.uses(
action("codecov/codecov-action", {
Copy link

Copilot AI Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider pinning the Codecov action version in this usage (similar to the ci.yml configuration) to ensure consistent behavior.

Suggested change
action("codecov/codecov-action", {
action("codecov/codecov-action@v2", {

Copilot uses AI. Check for mistakes.
with: {
token: "${{ secrets.CODECOV_TOKEN }}",
files: "coverage/lcov.info",
disable_search: "true",
verbose: "true",
},
}),
),
);

workflow.addJob(
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DO NOT EDIT THIS FILE
# This file is automatically generated by ghats (https://www.npmjs.com/package/ghats)
# Edit the workflow in .github/workflows/ci.ts instead, and run `ghats build` to update this file.
{"name":"CI","on":{"pull_request":{"branches":["main"]},"push":{"branches":["main"]}},"permissions":{},"jobs":{"test":{"runs-on":"ubuntu-latest","permissions":{"contents":"read"},"timeout-minutes":5,"steps":[{"with":{"persist-credentials":"false"},"uses":"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"},{"uses":"jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8"},{"with":{"path":"~/.bun/install/cache","key":"${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}","restore-keys":"${{ runner.os }}-bun-"},"uses":"actions/cache@5a3ec84eff668545956fd18022155c47e93e2684"},{"run":"bun install --frozen-lockfile"},{"run":"bun test"}]},"build-workflow":{"runs-on":"ubuntu-latest","permissions":{"contents":"read"},"timeout-minutes":5,"steps":[{"with":{"persist-credentials":"false"},"uses":"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"},{"uses":"jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8"},{"with":{"path":"~/.bun/install/cache","key":"${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}","restore-keys":"${{ runner.os }}-bun-"},"uses":"actions/cache@5a3ec84eff668545956fd18022155c47e93e2684"},{"run":"bun install --frozen-lockfile"},{"run":"\ncat <<EOF > ./.github/workflows/example.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;\nEOF\n"},{"run":"bun run ./lib/cli/index.ts build ./.github/workflows/example.ts"},{"run":"cat ./.github/workflows/example.yml"}]}}}
{"name":"CI","on":{"pull_request":{"branches":["main"]},"push":{"branches":["main"]}},"permissions":{},"jobs":{"test":{"runs-on":"ubuntu-latest","permissions":{"contents":"read"},"timeout-minutes":5,"steps":[{"with":{"persist-credentials":"false"},"uses":"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"},{"uses":"jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8"},{"with":{"path":"~/.bun/install/cache","key":"${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}","restore-keys":"${{ runner.os }}-bun-"},"uses":"actions/cache@5a3ec84eff668545956fd18022155c47e93e2684"},{"run":"bun install --frozen-lockfile"},{"run":"bun test --coverage --coverage-reporter=lcov"},{"with":{"token":"${{ secrets.CODECOV_TOKEN }}","files":"coverage/lcov.info","disable_search":"true","verbose":"true"},"uses":"codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574"}]},"build-workflow":{"runs-on":"ubuntu-latest","permissions":{"contents":"read"},"timeout-minutes":5,"steps":[{"with":{"persist-credentials":"false"},"uses":"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"},{"uses":"jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8"},{"with":{"path":"~/.bun/install/cache","key":"${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}","restore-keys":"${{ runner.os }}-bun-"},"uses":"actions/cache@5a3ec84eff668545956fd18022155c47e93e2684"},{"run":"bun install --frozen-lockfile"},{"run":"\ncat <<EOF > ./.github/workflows/example.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;\nEOF\n"},{"run":"bun run ./lib/cli/index.ts build ./.github/workflows/example.ts"},{"run":"cat ./.github/workflows/example.yml"}]}}}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# GitHub Actions with TypeScript

[![NPM Version](https://img.shields.io/npm/v/ghats)](https://www.npmjs.com/package/ghats)
[![codecov](https://codecov.io/gh/koki-develop/ghats/graph/badge.svg?token=M38AAFPXC1)](https://codecov.io/gh/koki-develop/ghats)
[![GitHub License](https://img.shields.io/github/license/koki-develop/ghats)](./LICENSE)

```ts
Expand Down