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
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { describe, expect, it, vi } from "vitest";

process.env.GITHUB_REPOSITORY_OWNER ??= "hoverkraft-tech";
process.env.GITHUB_REPOSITORY ??= "hoverkraft-tech/public-docs";

const { ApplicationBiomeFormatter } = await import(
"../lib/builders/application-biome-formatter.js"
);

describe("ApplicationBiomeFormatter", () => {
it("runs biome check --write from the application root", async () => {
const exec = vi.fn().mockResolvedValue({ stdout: "", stderr: "" });
const formatter = new ApplicationBiomeFormatter({
applicationRoot: "/repo/application",
exec,
});

await formatter.format("/repo/application/src/pages/index.tsx");

expect(exec).toHaveBeenCalledWith(
"npm",
[
"--prefix",
"/repo/application",
"exec",
"--",
"biome",
"check",
"--write",
"src/pages/index.tsx",
],
{
cwd: "/repo/application",
},
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@ const { APPLICATION_ROOT } = require("../constants");
const execFileAsync = promisify(execFile);

class ApplicationBiomeFormatter {
constructor({ applicationRoot = APPLICATION_ROOT } = {}) {
constructor({
applicationRoot = APPLICATION_ROOT,
exec = execFileAsync,
} = {}) {
this.applicationRoot = applicationRoot;
this.exec = exec;
}

async format(filePath) {
const relativePath = path.relative(this.applicationRoot, filePath);

await execFileAsync(
await this.exec(
"npm",
[
"--prefix",
this.applicationRoot,
"exec",
"--",
"biome",
"format",
"check",
"--write",
relativePath,
],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions: {}

jobs:
linter:
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@624be17604ee0a7378488191aacb35851e7cf001 # 0.37.1
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2334d395217f9811699dbd4ace9d8559e4d99e0d # 0.37.3
permissions:
actions: read
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: {}

jobs:
greetings:
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@624be17604ee0a7378488191aacb35851e7cf001 # 0.37.1
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@2334d395217f9811699dbd4ace9d8559e4d99e0d # 0.37.3
permissions:
contents: read
issues: write
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

Expand All @@ -29,7 +29,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- id: generate-github-actions-docs
uses: hoverkraft-tech/ci-dokumentor@3258ef0de948ec25e5939618d5ef510445aed869 # 0.3.1
uses: hoverkraft-tech/ci-dokumentor@301ef70a95e03b39e07ee0d3dc2da21de82e51ce # 0.4.0
with:
source: |
.github/actions/**/action.yml
Expand All @@ -41,7 +41,7 @@ jobs:
client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }}
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} # zizmor: ignore[secrets-outside-env]

- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@624be17604ee0a7378488191aacb35851e7cf001 # 0.37.1
- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@2334d395217f9811699dbd4ace9d8559e4d99e0d # 0.37.3
with:
github-token: ${{ steps.generate-token.outputs.token }}
branch: docs/action-documentation-update
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
url: ${{ steps.deployment.outputs.url }}
steps:
- id: deployment
uses: hoverkraft-tech/ci-github-publish/actions/deploy/github-pages@b2562b46714e535a0113f90f554b55e1248212c1 # 0.26.3
uses: hoverkraft-tech/ci-github-publish/actions/deploy/github-pages@607069025f6c1312680ed0864c4d9f4338b82dfe # 0.26.5
with:
build-path: application/build
build-artifact-id: ${{ needs.ci.outputs.build-artifact-id }}
2 changes: 1 addition & 1 deletion .github/workflows/need-fix-to-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@624be17604ee0a7378488191aacb35851e7cf001 # 0.37.1
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@2334d395217f9811699dbd4ace9d8559e4d99e0d # 0.37.3
permissions:
contents: read
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@624be17604ee0a7378488191aacb35851e7cf001 # 0.37.1
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@2334d395217f9811699dbd4ace9d8559e4d99e0d # 0.37.3
permissions:
contents: write
pull-requests: write
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@624be17604ee0a7378488191aacb35851e7cf001 # 0.37.1
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@2334d395217f9811699dbd4ace9d8559e4d99e0d # 0.37.3
permissions:
issues: write
pull-requests: write
2 changes: 1 addition & 1 deletion .github/workflows/sync-docs-dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-docs-receiver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }}
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} # zizmor: ignore[secrets-outside-env]

- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@624be17604ee0a7378488191aacb35851e7cf001 # 0.30.21
- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@2334d395217f9811699dbd4ace9d8559e4d99e0d # 0.30.21
with:
github-token: ${{ steps.generate_token.outputs.token }}
branch: docs/sync-documentation-${{ github.event.client_payload.repository }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,39 +186,39 @@ permissions:
| | Accepts either a single username string (default format) or a JSON object using the same keys as `oci-registry`. | | |
| | JSON example: | | |
| | `{"pull:private":"$\{{ github.repository_owner }}","push":"$\{{ github.repository_owner }}"}` | | |
| | See [https://github.com/docker/login-action#usage](https://github.com/docker/login-action#usage). | | |
| | See [https://github.com/docker/login-action#usage](https://github.com/docker/login-action#usage). | | |
| **`oci-registry-password`** | Password or personal access token configuration used to log against OCI registries. | **true** | `${{ github.token }}` |
| | Accepts either a single password/token string (default format) or a JSON object using the same keys as `oci-registry`. | | |
| | JSON example: `{"pull:private":"$\{{ github.token }}","push":"$\{{ github.token }}"}` | | |
| | Can be passed in using `secrets.GITHUB_TOKEN`. | | |
| | See [https://github.com/docker/login-action#usage](https://github.com/docker/login-action#usage). | | |
| | See [https://github.com/docker/login-action#usage](https://github.com/docker/login-action#usage). | | |
| **`repository`** | Repository name. | **false** | `${{ github.repository }}` |
| | Example: `my-org/my-repo`. | | |
| | See [Docker get-image-metadata action](../get-image-metadata/index.md). | | |
| | See [Docker get-image-metadata action](../get-image-metadata/index.md). | | |
| **`image`** | Additional image name. | **false** | - |
| | Example: `application`. | | |
| | See [Docker get-image-metadata action](../get-image-metadata/index.md). | | |
| | See [Docker get-image-metadata action](../get-image-metadata/index.md). | | |
| **`tag`** | Force image tag to publish | **false** | - |
| **`platform`** | Platform to build for. Example: `linux/amd64`. | **true** | - |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| **`context`** | Build's context is the set of files located in the specified PATH or URL. | **false** | `.` |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| **`dockerfile`** | Location of Dockerfile (defaults to Dockerfile). | **false** | `Dockerfile` |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| **`build-args`** | List of build-time variables. | **false** | - |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| **`target`** | Sets the target stage to build. | **false** | - |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| | See [https://github.com/docker/build-push-action#inputs](https://github.com/docker/build-push-action#inputs). | | |
| **`secrets`** | List of secrets to expose to the build. | **false** | - |
| | See [https://docs.docker.com/build/ci/github-actions/secrets/](https://docs.docker.com/build/ci/github-actions/secrets/). | | |
| | See [https://docs.docker.com/build/ci/github-actions/secrets/](https://docs.docker.com/build/ci/github-actions/secrets/). | | |
| **`secret-envs`** | List of secret environment variables to expose to the build (e.g., `key=envname, MY_SECRET=MY_ENV_VAR`). | **false** | - |
| | See [https://docs.docker.com/build/ci/github-actions/secrets/](https://docs.docker.com/build/ci/github-actions/secrets/). | | |
| | See [https://docs.docker.com/build/ci/github-actions/secrets/](https://docs.docker.com/build/ci/github-actions/secrets/). | | |
| **`cache-type`** | Cache type. Set to `false` or empty to disable cache entirely. | **false** | `gha` |
| | For `gha`, cache restore remains enabled on untrusted default-branch-scoped triggers, | | |
| | but cache export is skipped automatically because GitHub only grants read-only cache access there. | | |
| | See [https://docs.docker.com/build/cache/backends](https://docs.docker.com/build/cache/backends). | | |
| | See [https://docs.docker.com/build/cache/backends](https://docs.docker.com/build/cache/backends). | | |
| **`buildkitd-config-inline`** | Inline BuildKit daemon configuration. | **false** | - |
| | See [https://github.com/docker/setup-buildx-action#inputs](https://github.com/docker/setup-buildx-action#inputs). | | |
| | See [https://github.com/docker/setup-buildx-action#inputs](https://github.com/docker/setup-buildx-action#inputs). | | |
| | Example for insecure registry: | | |
| | <!-- textlint-disable --><pre lang="ini">[registry."my-registry.local:5000"]&#13; http = true&#13; insecure = true</pre><!-- textlint-enable --> | | |
| **`multi-platform`** | Whether this build participates in a multi-platform image publication. | **false** | `false` |
Expand Down
Loading
Loading