Skip to content
Open
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
3 changes: 1 addition & 2 deletions .github/composite/build-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Set up pnpm
uses: pnpm/action-setup@v5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Set up OpenJDK 25
uses: actions/setup-java@v5
Expand Down
3 changes: 1 addition & 2 deletions .github/composite/deploy-standup-bot/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ runs:
id: build-image
uses: ./.github/composite/build-image/internal/standup-bot
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Deploy standup-bot image tag
shell: bash
Expand Down
3 changes: 1 addition & 2 deletions .github/composite/notion-checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Run script
id: run_script
Expand Down
3 changes: 1 addition & 2 deletions .github/composite/redeploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Set up pnpm
uses: pnpm/action-setup@v5
Expand Down
3 changes: 1 addition & 2 deletions .github/composite/redeploy/internal/standup-bot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/composite/setup-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ inputs:
description: "GitHub token used to send message"
required: false
default: ${{ github.token }}
SECRETS:
description: "Pass toJSON(secrets) from the calling workflow to expose all secrets as env vars."
required: false

runs:
using: "composite"
Expand Down
12 changes: 4 additions & 8 deletions .github/composite/test/backend-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ name: "Backend test"
description: "Run backend tests"

inputs:
GPG_PRIVATE_KEY:
description: "GPG Private Key"
required: true
GPG_PASSPHRASE:
description: "GPG Passphrase"
required: true
SECRETS:
description: "Pass toJSON(secrets) from the calling workflow to expose all secrets as env vars."
required: false
UPLOAD_TEST_COV:
description: "Boolean indicating whether tests should be uploaded to our code coverage provider or not."
required: false
Expand All @@ -19,8 +16,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Set up pnpm
uses: pnpm/action-setup@v5
Expand Down
3 changes: 1 addition & 2 deletions .github/composite/test/frontend-pre-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Set up OpenJDK 25
uses: actions/setup-java@v5
Expand Down
3 changes: 1 addition & 2 deletions .github/composite/test/frontend-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Set up pnpm
uses: pnpm/action-setup@v5
Expand Down
3 changes: 1 addition & 2 deletions .github/composite/validate-db/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ runs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Set up OpenJDK 25
uses: actions/setup-java@v5
Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/auto-approval/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { RestEndpointMethodTypes } from "@octokit/rest";

import { getEnvVariables } from "load-secrets/env/load";
import { checkNotionPrAndGetTask } from "notion/pr";
import { getNotionClient } from "notion/sdk";
import { Octokit } from "octokit";
Expand Down Expand Up @@ -34,7 +33,7 @@ const {
.strict()
.parse();

function parseCiEnv(ciEnv: Record<string, string>) {
function parseCiEnv(ciEnv: Record<string, string | undefined>) {
const notionDbId = (() => {
const v = ciEnv["NOTION_TASK_DB_ID"];
if (!v) {
Expand All @@ -57,7 +56,7 @@ function parseCiEnv(ciEnv: Record<string, string>) {
};
}

const { notionDbId, notionSecret } = parseCiEnv(await getEnvVariables(["ci"]));
const { notionDbId, notionSecret } = parseCiEnv(process.env);
const notionClient = getNotionClient(notionSecret);

const taskAndPr = await checkNotionPrAndGetTask(notionClient, prId, notionDbId);
Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/build-image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ const serverProfiles = environment === "staging" ? "stg" : "prod";

async function main() {
try {
const ciEnv = await getEnvVariables(["ci"]);
const { dockerHubPat } = parseCiEnv(ciEnv);
const { dockerHubPat } = parseCiEnv(process.env);
const localDbEnv = await db.start();
const ciAppEnv = await getEnvVariables(["ci-app"]);

Expand Down Expand Up @@ -126,7 +125,7 @@ async function main() {
}
}

function parseCiEnv(ciEnv: Record<string, string>) {
function parseCiEnv(ciEnv: Record<string, string | undefined>) {
const dockerHubPat = (() => {
const v = ciEnv["DOCKER_HUB_PAT"];
if (!v) {
Expand Down
6 changes: 2 additions & 4 deletions .github/scripts/build-image/internal/standup-bot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { $ } from "bun";
import { getEnvVariables } from "load-secrets/env/load";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";

Expand Down Expand Up @@ -27,8 +26,7 @@ const { dockerUpload, getGhaOutput, githubOutputFile } = await yargs(
.parse();

async function main() {
const ciEnv = await getEnvVariables(["ci"]);
const { dockerHubPat } = parseCiEnv(ciEnv);
const { dockerHubPat } = parseCiEnv(process.env);

// copy old tz format from build-image.sh
const timestamp = new Date()
Expand Down Expand Up @@ -94,7 +92,7 @@ async function main() {
}
}

function parseCiEnv(ciEnv: Record<string, string>) {
function parseCiEnv(ciEnv: Record<string, string | undefined>) {
const dockerHubPat = (() => {
const v = ciEnv["DOCKER_HUB_PAT"];
if (!v) {
Expand Down
7 changes: 3 additions & 4 deletions .github/scripts/deploy/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Environment } from "@tahminator/pipeline";
import type { Type } from "types";

import { GitHubClient, Utils } from "@tahminator/pipeline";
import { GitHubClient } from "@tahminator/pipeline";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";

Expand All @@ -24,8 +24,7 @@ const { environment, newTagVersion, type } = await yargs(hideBin(process.argv))
.parse();

async function main() {
const ciEnv = await Utils.getEnvVariables(["ci"]);
const { ghPat } = parseCiEnv(ciEnv);
const { ghPat } = parseCiEnv(process.env);
const ghClient = new GitHubClient(ghPat);

if (type === "web") {
Expand All @@ -51,7 +50,7 @@ async function main() {
}
}

function parseCiEnv(ciEnv: Record<string, string>) {
function parseCiEnv(ciEnv: Record<string, string | undefined>) {
const ghPat = (() => {
const v = ciEnv["GH_PAT"];
if (!v) {
Expand Down
7 changes: 2 additions & 5 deletions .github/scripts/notion/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { getEnvVariables } from "load-secrets/env/load";
import { _checkCommits } from "notion/commits";
import { checkNotionPrAndGetTask } from "notion/pr";
import { _validateNotionTask } from "notion/pr/validate-ticket";
Expand Down Expand Up @@ -42,9 +41,7 @@ const {
async function main() {
console.log(`GET_GHA_OUTPUT=${getGhaOutput}`);

const { notionDbId, notionSecret } = parseCiEnv(
await getEnvVariables(["ci"]),
);
const { notionDbId, notionSecret } = parseCiEnv(process.env);
const client = getNotionClient(notionSecret);

const { taskId, taskContent, task, taskPublicUrl } =
Expand Down Expand Up @@ -72,7 +69,7 @@ async function main() {
}
}

function parseCiEnv(ciEnv: Record<string, string>) {
function parseCiEnv(ciEnv: Record<string, string | undefined>) {
const notionDbId = (() => {
const v = ciEnv["NOTION_TASK_DB_ID"];
if (!v) {
Expand Down
6 changes: 2 additions & 4 deletions .github/scripts/redeploy/internal/standup-bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ async function main() {
// await $`git-crypt unlock`;

const { bearerAuth, serverUrl, projectUuid, serverUuid } = parseCiEnv(
await getEnvVariables(["ci"], {
baseDir: "internal",
}),
process.env,
);

const client = await initClient(bearerAuth, serverUrl);
Expand Down Expand Up @@ -74,7 +72,7 @@ async function main() {
}
}

function parseCiEnv(ciEnv: Record<string, string>) {
function parseCiEnv(ciEnv: Record<string, string | undefined>) {
const bearerAuth = (() => {
const v = ciEnv["COOLIFY_BEARER_AUTH"];
if (!v) {
Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/test/run-backend-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ async function main() {
await $$`./mvnw clean verify -Dspring.profiles.active=ci`;

if (shouldUploadCoverage) {
const ciEnv = await getEnvVariables(["ci"]);
const { sonarToken } = parseCiEnv(ciEnv);
const { sonarToken } = parseCiEnv(process.env);
await uploadBackendTests(sonarToken);
}
} finally {
Expand All @@ -55,7 +54,7 @@ async function main() {
}
}

function parseCiEnv(ciEnv: Record<string, string>) {
function parseCiEnv(ciEnv: Record<string, string | undefined>) {
const sonarToken = (() => {
const v = ciEnv["SONAR_TOKEN"];
if (!v) {
Expand Down
6 changes: 2 additions & 4 deletions .github/scripts/test/run-e2e-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const { actionUrl, skipDiscordMessage } = await yargs(hideBin(process.argv))
.parse();

async function main() {
const { discordToken, discordChannelId } = parseCiEnv(
await getEnvVariables(["ci"]),
);
const { discordToken, discordChannelId } = parseCiEnv(process.env);
try {
const ciAppEnv = await getEnvVariables(["ci-app"]);

Expand Down Expand Up @@ -81,7 +79,7 @@ main()
process.exit(1);
});

function parseCiEnv(env: Record<string, string>) {
function parseCiEnv(env: Record<string, string | undefined>) {
const discordToken = env["DISCORD_TOKEN"];
if (!discordToken) {
throw new Error("Missing DISCORD_TOKEN from .env.ci");
Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/test/run-frontend-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ async function main() {
await $$`pnpm --dir js run test`;

if (shouldUploadCoverage) {
const ciEnv = await getEnvVariables(["ci"]);
const { sonarToken } = parseCiEnv(ciEnv);
const { sonarToken } = parseCiEnv(process.env);

await uploadFrontendTests(sonarToken);
}
Expand All @@ -41,7 +40,7 @@ async function main() {
}
}

function parseCiEnv(ciEnv: Record<string, string>) {
function parseCiEnv(ciEnv: Record<string, string | undefined>) {
const sonarToken = (() => {
const v = ciEnv["SONAR_TOKEN"];
if (!v) {
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ai-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ jobs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Load secrets
uses: ./.github/composite/load-secrets
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}
UNLOAD_ENVIRONMENTS: ci

- name: Post /review command
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/ai-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,20 @@ jobs:
- name: Setup CI
uses: ./.github/composite/setup-ci
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}

- name: Load secrets
uses: ./.github/composite/load-secrets
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}
UNLOAD_ENVIRONMENTS: ci

- name: Run composite workflow
uses: ./.github/composite/notion-checks
id: notion_check
with:
PR_ID: ${{ github.event.number || github.event.issue.number }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SECRETS: ${{ toJSON(secrets) }}
GET_GHA_OUTPUT: "true"
VALIDATE_TICKET: "false"

Expand Down
Loading
Loading