diff --git a/.github/composite/build-image/action.yml b/.github/composite/build-image/action.yml index e7c891442..72fb703c8 100644 --- a/.github/composite/build-image/action.yml +++ b/.github/composite/build-image/action.yml @@ -26,8 +26,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} - name: Set up pnpm diff --git a/.github/composite/build-image/internal/standup-bot/action.yml b/.github/composite/build-image/internal/standup-bot/action.yml index 9f154e0b2..8db941c71 100644 --- a/.github/composite/build-image/internal/standup-bot/action.yml +++ b/.github/composite/build-image/internal/standup-bot/action.yml @@ -27,8 +27,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} - name: Set up OpenJDK 25 diff --git a/.github/composite/notion-checks/action.yml b/.github/composite/notion-checks/action.yml index dd91757a8..62e7f4ffd 100644 --- a/.github/composite/notion-checks/action.yml +++ b/.github/composite/notion-checks/action.yml @@ -26,8 +26,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} - name: Run script diff --git a/.github/composite/pr-description-check/action.yml b/.github/composite/pr-description-check/action.yml index 75a3040e5..0fa9784ea 100644 --- a/.github/composite/pr-description-check/action.yml +++ b/.github/composite/pr-description-check/action.yml @@ -10,7 +10,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 + with: + LINT_CI: true - name: Run script id: run_script diff --git a/.github/composite/redeploy/action.yml b/.github/composite/redeploy/action.yml index 22d60fe9f..8ee4b415e 100644 --- a/.github/composite/redeploy/action.yml +++ b/.github/composite/redeploy/action.yml @@ -26,8 +26,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} HEADSCALE_ADDRESS: ${{ inputs.HEADSCALE_ADDRESS }} HEADSCALE_USER: ${{ inputs.HEADSCALE_USER }} diff --git a/.github/composite/redeploy/internal/standup-bot/action.yml b/.github/composite/redeploy/internal/standup-bot/action.yml index 889ad69fe..76773a012 100644 --- a/.github/composite/redeploy/internal/standup-bot/action.yml +++ b/.github/composite/redeploy/internal/standup-bot/action.yml @@ -17,8 +17,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} - name: Expose GitHub Runtime diff --git a/.github/composite/setup-ci/action.yml b/.github/composite/setup-ci/action.yml deleted file mode 100644 index a44314683..000000000 --- a/.github/composite/setup-ci/action.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: "Setup CI" -description: "Setup dependencies required to run CI (disable man-db)" - -inputs: - GITHUB_TOKEN: - 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 - HEADSCALE_ADDRESS: - description: "Headscale address (passing any of the Headscale args in will enable Headscale support for the job)" - required: false - HEADSCALE_USER: - description: "Headscale user (passing any of the Headscale args in will enable Headscale support for the job)" - required: false - HEADSCALE_PREAUTHKEY: - description: "Headscale preauthkey (passing any of the Headscale args in will enable Headscale support for the job)" - required: false - -runs: - using: "composite" - steps: - - name: Setup - uses: tahminator/pipeline/actions/setup@1.0.73 - with: - GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} - SECRETS: ${{ inputs.SECRETS }} - HEADSCALE_USER: ${{ inputs.HEADSCALE_USER }} - HEADSCALE_ADDRESS: ${{ inputs.HEADSCALE_ADDRESS }} - HEADSCALE_PREAUTHKEY: ${{ inputs.HEADSCALE_PREAUTHKEY }} - - - name: Test CI scripts - shell: bash - run: bun run --cwd .github/scripts test diff --git a/.github/composite/test/backend-pre-test/action.yml b/.github/composite/test/backend-pre-test/action.yml index 8742852f2..bb156a1b9 100644 --- a/.github/composite/test/backend-pre-test/action.yml +++ b/.github/composite/test/backend-pre-test/action.yml @@ -4,7 +4,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 + with: + LINT_CI: true - name: Set up OpenJDK 25 uses: actions/setup-java@v5 diff --git a/.github/composite/test/backend-test/action.yml b/.github/composite/test/backend-test/action.yml index b2c7ec33b..675669f6b 100644 --- a/.github/composite/test/backend-test/action.yml +++ b/.github/composite/test/backend-test/action.yml @@ -14,8 +14,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} - name: Set up pnpm diff --git a/.github/composite/test/frontend-pre-test/action.yml b/.github/composite/test/frontend-pre-test/action.yml index 7c0d146fe..022f5f412 100644 --- a/.github/composite/test/frontend-pre-test/action.yml +++ b/.github/composite/test/frontend-pre-test/action.yml @@ -10,8 +10,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} - name: Set up OpenJDK 25 diff --git a/.github/composite/test/frontend-test/action.yml b/.github/composite/test/frontend-test/action.yml index 3cccc0f7f..73d4460c1 100644 --- a/.github/composite/test/frontend-test/action.yml +++ b/.github/composite/test/frontend-test/action.yml @@ -14,8 +14,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} - name: Set up pnpm diff --git a/.github/composite/validate-db/action.yml b/.github/composite/validate-db/action.yml index f6c1fcce3..ef9a6aff7 100644 --- a/.github/composite/validate-db/action.yml +++ b/.github/composite/validate-db/action.yml @@ -26,8 +26,9 @@ runs: using: "composite" steps: - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ inputs.SECRETS }} HEADSCALE_ADDRESS: ${{ inputs.HEADSCALE_ADDRESS }} HEADSCALE_USER: ${{ inputs.HEADSCALE_USER }} diff --git a/.github/scripts/bun.lock b/.github/scripts/bun.lock index f58c1c94b..b70e775d2 100644 --- a/.github/scripts/bun.lock +++ b/.github/scripts/bun.lock @@ -9,7 +9,7 @@ "@digitalocean/dots": "^1.7.0", "@notionhq/client": "^5.7.0", "@octokit/rest": "^22.0.1", - "@tahminator/pipeline": "^1.0.76", + "@tahminator/pipeline": "1.0.90", "@types/yargs": "^17.0.35", "bun": "^1.3.6", "coolify": "https://github.com/tahminator/Coolify-TypeScript-SDK#8e19e18635ea2b095a9c39c574d22eefd938441f", @@ -348,7 +348,7 @@ "@std-uritemplate/std-uritemplate": ["@std-uritemplate/std-uritemplate@2.0.8", "", {}, "sha512-8oj7jKksoTRxjdPkWKX9FyOKDS8ORBm+ZfTSHm0f3eYha8cI0O1d57gyduOIAX7Y2uUukNDNlxlvGb+FFkE7yQ=="], - "@tahminator/pipeline": ["@tahminator/pipeline@1.0.85", "", { "dependencies": { "@octokit/auth-app": "^8.2.0", "@octokit/rest": "^22.0.1", "@pulumi/pulumi": "^3.258.0", "ansi-to-html": "^0.7.2", "fast-xml-builder": "^1.1.5", "fast-xml-parser": "^5.7.2", "neverthrow": "^8.2.0", "semver": "^7.7.4", "xml-trueformat": "^0.9.5", "yaml": "^2.8.2", "yargs": "^18.0.0", "zod": "^4.3.6" }, "peerDependencies": { "typescript": "^5" } }, "sha512-5nNvF1mCcNJw43+4T+K8H8Gs1GlGyiL+FMRYZtVAz9gCigq3YCLjMNOUBDVG8+8VWj2qyUY/CIywEaLfJBSbgA=="], + "@tahminator/pipeline": ["@tahminator/pipeline@1.0.90", "", { "dependencies": { "@octokit/auth-app": "^8.2.0", "@octokit/rest": "^22.0.1", "@pulumi/pulumi": "^3.258.0", "ansi-to-html": "^0.7.2", "fast-xml-builder": "^1.1.5", "fast-xml-parser": "^5.7.2", "neverthrow": "^8.2.0", "semver": "^7.7.4", "xml-trueformat": "^0.9.5", "yaml": "^2.8.2", "yargs": "^18.0.0", "zod": "^4.3.6" }, "peerDependencies": { "typescript": "^5" } }, "sha512-QPeHpxkO0i97ZXAozHil7B2rCODO7uzP8x5LInbvM1mMK3APyF0ZXlDFqU4dny3f1yQg5E0YQi1+Jn5yw3cksA=="], "@tufjs/canonical-json": ["@tufjs/canonical-json@2.0.0", "", {}, "sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA=="], diff --git a/.github/scripts/load-slash-commands/index.ts b/.github/scripts/load-slash-commands/index.ts index d27e54d25..5ba5cc842 100644 --- a/.github/scripts/load-slash-commands/index.ts +++ b/.github/scripts/load-slash-commands/index.ts @@ -1,41 +1,3 @@ import { COMMANDS } from "load-slash-commands/commands"; -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; -const { getGhaOutput, githubOutput: githubOutputFile } = await yargs( - hideBin(process.argv), -) - .option("getGhaOutput", { - type: "boolean", - describe: "Enable GitHub Actions output", - default: false, - }) - .option("githubOutput", { - type: "string", - describe: "Path to GITHUB_OUTPUT", - default: process.env.GITHUB_OUTPUT, - }) - .strict() - .parse(); - -async function main() { - const cmds = COMMANDS.filter((c) => c.length > 0).join("\n"); - - if (getGhaOutput && githubOutputFile) { - console.log("Outputting cmds context..."); - const w = Bun.file(githubOutputFile).writer(); - await w.write(`commands< { - process.exit(); - }) - .catch(() => { - process.exit(1); - }); +console.log(COMMANDS.join("\n")); diff --git a/.github/scripts/package.json b/.github/scripts/package.json index b8c24fd94..d53a1a778 100644 --- a/.github/scripts/package.json +++ b/.github/scripts/package.json @@ -22,7 +22,7 @@ "@digitalocean/dots": "^1.7.0", "@notionhq/client": "^5.7.0", "@octokit/rest": "^22.0.1", - "@tahminator/pipeline": "^1.0.76", + "@tahminator/pipeline": "1.0.90", "@types/yargs": "^17.0.35", "bun": "^1.3.6", "coolify": "https://github.com/tahminator/Coolify-TypeScript-SDK#8e19e18635ea2b095a9c39c574d22eefd938441f", diff --git a/.github/workflows/ai-command.yml b/.github/workflows/ai-command.yml index 845f4dbf2..a96b0cd17 100644 --- a/.github/workflows/ai-command.yml +++ b/.github/workflows/ai-command.yml @@ -59,8 +59,9 @@ jobs: ref: ${{ needs.getPRHead.outputs.sha }} - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ toJSON(secrets) }} - name: Load secrets diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml index 7b9ef2ce1..04d27a120 100644 --- a/.github/workflows/ai-review.yml +++ b/.github/workflows/ai-review.yml @@ -56,8 +56,9 @@ jobs: ref: ${{ needs.getPRHead.outputs.sha }} - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ toJSON(secrets) }} - name: Load secrets diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 55975974c..9de89144f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -97,8 +97,9 @@ jobs: uses: actions/checkout@v6 - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ toJSON(secrets) }} - name: Set up pnpm diff --git a/.github/workflows/copy-command.yml b/.github/workflows/copy-command.yml index cb0aa76c1..00824ef0d 100644 --- a/.github/workflows/copy-command.yml +++ b/.github/workflows/copy-command.yml @@ -63,8 +63,9 @@ jobs: ref: ${{ needs.getPRHead.outputs.sha }} - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ toJSON(secrets) }} HEADSCALE_ADDRESS: ${{ secrets.HEADSCALE_ADDRESS }} HEADSCALE_USER: ${{ secrets.HEADSCALE_USER }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 0b8054be1..de7209079 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -24,8 +24,9 @@ jobs: uses: actions/checkout@v6 - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ toJSON(secrets) }} - name: Set up pnpm diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index e4c3407ed..9b560d483 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -18,8 +18,9 @@ jobs: uses: actions/checkout@v6 - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ toJSON(secrets) }} - name: Run script diff --git a/.github/workflows/migrate-command.yml b/.github/workflows/migrate-command.yml index eb0ba70a2..f955b0b05 100644 --- a/.github/workflows/migrate-command.yml +++ b/.github/workflows/migrate-command.yml @@ -53,8 +53,9 @@ jobs: fetch-depth: 0 - name: Setup CI - uses: ./.github/composite/setup-ci + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: + LINT_CI: true SECRETS: ${{ toJSON(secrets) }} HEADSCALE_ADDRESS: ${{ secrets.HEADSCALE_ADDRESS }} HEADSCALE_USER: ${{ secrets.HEADSCALE_USER }} diff --git a/.github/workflows/slash.yml b/.github/workflows/slash.yml index 3ddb85609..f563a4d80 100644 --- a/.github/workflows/slash.yml +++ b/.github/workflows/slash.yml @@ -6,74 +6,31 @@ on: types: [created] permissions: - contents: write - issues: write - pull-requests: write + contents: read jobs: slashCommandDispatch: + if: >- + github.event.issue.pull_request && + startsWith(github.event.comment.body, '/') runs-on: ubuntu-latest steps: - - name: Get PR head SHA - id: pr-head - uses: actions/github-script@v8 - with: - result-encoding: string - script: | - const prId = ${{ github.event.issue.number }}; - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: parseInt(prId, 10) - }); - return pr.head.sha; - - - name: Get branch - id: branch - uses: actions/github-script@v8 - with: - result-encoding: string - script: | - const prId = ${{ github.event.issue.number }}; - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: parseInt(prId, 10) - }); - return pr.head.ref; - - name: Checkout Repository - uses: actions/checkout@v6 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ steps.pr-head.outputs.result }} - - - name: Setup CI - uses: ./.github/composite/setup-ci - with: - SECRETS: ${{ toJSON(secrets) }} - - - name: Run script - run: bun run .github/scripts/load-slash-commands --get-gha-output=true - id: cmds + # stay on trusted default-branch code until the commands action authorizes the commenter + ref: ${{ github.event.repository.default_branch }} + persist-credentials: false - - name: Create GitHub App Token - uses: actions/create-github-app-token@v3 - id: app-token + - name: Setup pipeline + uses: tahminator/pipeline/actions/setup@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: - app-id: ${{ secrets._GITHUB_APP_APP_ID }} - private-key: ${{ secrets._GITHUB_APP_PEM_CONTENT }} + LINT_CI: true - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v4 + uses: tahminator/pipeline/actions/commands@ff36293f28519b2b90d7e28918a6885d9baf019e # 1.0.90 with: - dispatch-type: workflow - token: ${{ steps.app-token.outputs.token }} - commands: | - ${{ steps.cmds.outputs.commands }} - static-args: | - repository=${{ github.repository }} - comment-id=${{ github.event.comment.id }} - prId=${{ github.event.issue.number }} - author=${{ github.actor }} - ref=${{ steps.branch.outputs.result }} + APP_ID: ${{ secrets._GITHUB_APP_APP_ID }} + PRIVATE_KEY: ${{ secrets._GITHUB_APP_PEM_CONTENT }} + DYNAMIC_COMMANDS_BUN_SCRIPT: .github/scripts/load-slash-commands/index.ts