@theholocron/cli 2.0.0-alpha.64 → 2.0.0-alpha.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +126 -1136
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -836,879 +836,132 @@ async function runUpgradeNode(input) {
|
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
838
|
//#endregion
|
|
839
|
+
//#region src/templates/actions/setup.yml
|
|
840
|
+
var setup_default = "name: Setup\ndescription: Prepare the environment and install project dependencies.\n\ninputs:\n node-version:\n description: Node.js version\n required: false\n default: \"22.x\"\n\nruns:\n using: composite\n\n steps:\n - uses: theholocron/.github/.github/actions/setup-node@main\n with:\n node-version: ${{ inputs.node-version }}\n\n - uses: theholocron/.github/.github/actions/install@main\n";
|
|
841
|
+
//#endregion
|
|
842
|
+
//#region src/templates/actions/install.yml
|
|
843
|
+
var install_default = "name: Install dependencies\ndescription: Install project dependencies with pnpm frozen lockfile.\n\nruns:\n using: composite\n\n steps:\n - name: Install dependencies\n if: ${{ hashFiles('pnpm-lock.yaml') != '' }}\n shell: bash\n run: pnpm install --frozen-lockfile\n";
|
|
844
|
+
//#endregion
|
|
845
|
+
//#region src/templates/actions/setup-node.yml
|
|
846
|
+
var setup_node_default = "name: Setup Node\ndescription: Install pnpm and Node.js with pnpm dependency caching.\n\ninputs:\n node-version:\n description: Node.js version\n required: false\n default: \"22.x\"\n\nruns:\n using: composite\n\n steps:\n - name: Setup pnpm\n if: ${{ hashFiles('pnpm-lock.yaml') != '' }}\n uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4\n\n - name: Setup Node.js\n uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4\n with:\n node-version: ${{ hashFiles('.node-version') != '' && '' || inputs.node-version }}\n node-version-file: ${{ hashFiles('.node-version') != '' && '.node-version' || '' }}\n cache: ${{ hashFiles('pnpm-lock.yaml') != '' && 'pnpm' || '' }}\n\n - name: Add node_modules/.bin to PATH\n shell: bash\n run: echo \"$GITHUB_WORKSPACE/node_modules/.bin\" >> $GITHUB_PATH\n";
|
|
847
|
+
//#endregion
|
|
848
|
+
//#region src/templates/workflows/audit.yml
|
|
849
|
+
var audit_default$1 = "name: Audit\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n build-script:\n description: Script to build and upload bundle stats to Codecov\n type: string\n required: false\n default: pnpm build\n secrets:\n CODECOV_TOKEN:\n required: false\n\njobs:\n bundle-size:\n name: Audit the bundle size\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n concurrency:\n group: audit-${{ github.ref }}\n cancel-in-progress: true\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n fetch-depth: 0\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: eval \"$BUILD_SCRIPT\"\n name: Build and upload bundle stats\n env:\n BUILD_SCRIPT: ${{ inputs.build-script }}\n CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}\n";
|
|
850
|
+
//#endregion
|
|
851
|
+
//#region src/templates/workflows/bookkeeping.yml
|
|
852
|
+
var bookkeeping_default$1 = "name: Bookkeeping\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n configuration-path:\n description: Path to the labeler configuration file in the calling repo\n type: string\n required: false\n default: .github/labeler.yml\n\njobs:\n label:\n name: Apply Labels\n permissions:\n contents: read\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 5\n concurrency:\n group: bookkeeping-${{ github.event.pull_request.number || github.event.issue.number }}\n cancel-in-progress: true\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n with:\n sparse-checkout: ${{ inputs.configuration-path || '.github/labeler.yml' }}\n sparse-checkout-cone-mode: false\n\n - uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4\n if: ${{ github.event_name == 'pull_request' && hashFiles(inputs.configuration-path || '.github/labeler.yml') != '' }}\n # v3.4 bundles Node 20; allow it to run under Actions' current default.\n env:\n ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true\n with:\n # Fall back to default path when triggered directly (not via workflow_call)\n # because inputs.* defaults only apply on workflow_call events.\n configuration-path: ${{ inputs.configuration-path || '.github/labeler.yml' }}\n include-title: 1\n include-body: 0\n sync-labels: 1\n enable-versioned-regex: 0\n repo-token: ${{ github.token }}\n";
|
|
853
|
+
//#endregion
|
|
854
|
+
//#region src/templates/workflows/codeql.yml
|
|
855
|
+
var codeql_default$1 = "name: CodeQL\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n language:\n description: CodeQL language to analyze\n type: string\n required: false\n default: javascript-typescript\n\njobs:\n analyze:\n name: Analyze (${{ inputs.language }})\n permissions:\n actions: read\n contents: read\n security-events: write\n runs-on: ubuntu-latest\n timeout-minutes: 45\n # Do not cancel in-progress security scans.\n concurrency:\n group: codeql-${{ github.ref }}\n cancel-in-progress: false\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0\n name: Initialize CodeQL\n with:\n languages: ${{ inputs.language }}\n\n - uses: github/codeql-action/autobuild@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0\n name: Autobuild\n\n - uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0\n name: Analyze\n with:\n category: /language:${{ inputs.language }}\n";
|
|
856
|
+
//#endregion
|
|
857
|
+
//#region src/templates/workflows/dependencies.yml
|
|
858
|
+
var dependencies_default$1 = "name: Dependencies\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n merge-token:\n description: >\n Optional privileged token for auto-merge. Falls back to GITHUB_TOKEN.\n Required when branch protection enforces required reviews — GITHUB_TOKEN\n cannot approve its own PRs.\n required: false\n\njobs:\n dependabot:\n name: Update the dependencies\n permissions:\n contents: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 5\n concurrency:\n group: dependencies-${{ github.event.pull_request.number }}\n cancel-in-progress: true\n if: github.event.pull_request.user.login == 'dependabot[bot]'\n steps:\n - uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0\n name: Fetch Dependabot metadata\n id: metadata\n\n - run: gh pr merge --auto --squash \"$PR_URL\"\n # --squash is intentional: repo protection sets allow_merge_commit: false,\n # so --merge would fail on any repo using the standard preset.\n name: Enable auto-merge for Dependabot PRs\n if: steps.metadata.outputs.update-type == 'version-update:semver-patch'\n env:\n PR_URL: ${{ github.event.pull_request.html_url }}\n GH_TOKEN: ${{ secrets.merge-token || github.token }}\n";
|
|
859
|
+
//#endregion
|
|
860
|
+
//#region src/templates/workflows/greetings.yml
|
|
861
|
+
var greetings_default$1 = "name: Greetings\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n\njobs:\n greeting:\n name: Greet first-time contributors\n permissions:\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 5\n # Group by the issue/PR number so duplicate events don't race each other.\n concurrency:\n group: greetings-${{ github.event.issue.number || github.event.pull_request.number }}\n cancel-in-progress: false\n steps:\n - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0\n name: Greet on first contribution\n with:\n script: |\n // Only greet on the initial open — ignore synchronize, reopened, etc.\n if (context.payload.action !== 'opened') return;\n\n const actor = context.actor;\n const { owner, repo } = context.repo;\n\n // Payload inspection is more reliable than context.eventName for detecting\n // whether this is an issue vs. PR event — works regardless of how GitHub\n // propagates event names through workflow_call chains.\n const isIssue = !!context.payload.issue && !context.payload.pull_request;\n // listForRepo returns both issues and PRs (GitHub treats PRs as issues),\n // sorted newest-first. Filter by type to track first-issue and first-PR\n // independently, and avoid search-index eventual-consistency lag.\n const { data: recent } = await github.rest.issues.listForRepo({\n owner, repo,\n creator: actor,\n state: 'all',\n per_page: 100\n });\n\n const sameType = recent.filter(item =>\n isIssue ? !item.pull_request : !!item.pull_request\n );\n\n if (sameType.length !== 1) return;\n const body = isIssue\n ? `Hey @${actor}!\\n\\nWe really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we are a limited number of volunteers, so it is possible that this will not be addressed as swiftly.\\n\\nYour patience is much appreciated and we will get back to you as quickly as possible.`\n : `Hey @${actor}!\\n\\nWe really appreciate you taking the time to help out with this PR. The collaborators on this project attempt to help as many people as possible, but we are a limited number of volunteers, so it is possible that this will not be addressed as swiftly.\\n\\nYour patience is much appreciated and we will get back to you as quickly as possible.`;\n\n await github.rest.issues.createComment({\n owner,\n repo,\n issue_number: context.issue.number,\n body\n });\n";
|
|
862
|
+
//#endregion
|
|
863
|
+
//#region src/templates/workflows/lint.yml
|
|
864
|
+
var lint_default$1 = "name: Lint\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n prettier-config:\n type: string\n required: false\n default: prettier.config.js\n yaml-config:\n type: string\n required: false\n default: yamllint.config.yml\n enable-auto-commit:\n description: Auto-commit super-linter fixes via GPG-signed commit\n type: boolean\n required: false\n default: false\n secrets:\n SUPER_LINTER_GPG_PRIVATE_KEY:\n required: false\n SUPER_LINTER_GPG_PASSPHRASE:\n required: false\n\njobs:\n super-lint:\n name: Lint entire codebase\n permissions:\n contents: write\n statuses: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n env:\n GPG_KEY_SET: ${{ secrets.SUPER_LINTER_GPG_PRIVATE_KEY != '' }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n fetch-depth: 0\n token: ${{ github.token }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n if: ${{ hashFiles('pnpm-lock.yaml') != '' }}\n\n - uses: super-linter/super-linter/slim@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0\n name: Run Super Linter\n env:\n GITHUB_TOKEN: ${{ github.token }}\n DEFAULT_BRANCH: ${{ github.event.pull_request.base.ref || github.event.repository.default_branch }}\n ANNOTATE_ONLY: true\n DISABLE_COMMENTS: false\n IGNORE_GITIGNORED_FILES: true\n LINTER_RULES_PATH: /\n EDITORCONFIG_FILE_NAME: \".editorconfig-checker.json\"\n FIX_ENV: true\n FIX_GRAPHQL_PRETTIER: true\n FIX_HTML_PRETTIER: true\n FIX_JAVASCRIPT_PRETTIER: true\n FIX_JSX_PRETTIER: true\n FIX_MARKDOWN_PRETTIER: true\n FIX_TSX: true\n FIX_TYPESCRIPT_PRETTIER: true\n PRETTIER_CONFIG: ${{ inputs.prettier-config }}\n VALIDATE_DOCKERFILE: true\n VALIDATE_EDITORCONFIG: true\n VALIDATE_ENV: true\n VALIDATE_GIT_COMMITLINT: true\n VALIDATE_GIT_MERGE_CONFLICT_MARKERS: true\n VALIDATE_GITHUB_ACTIONS: true\n VALIDATE_GITLEAKS: true\n VALIDATE_GRAPHQL_PRETTIER: true\n VALIDATE_HTML_PRETTIER: true\n VALIDATE_JAVASCRIPT_PRETTIER: true\n VALIDATE_JSX_PRETTIER: true\n VALIDATE_MARKDOWN_PRETTIER: true\n VALIDATE_TSX: true\n VALIDATE_TYPESCRIPT_PRETTIER: true\n VALIDATE_YAML: true\n YAML_CONFIG_FILE: ${{ inputs.yaml-config }}\n\n - uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0\n name: Import GPG Key\n # Conditions mirror auto-commit exactly — no point importing GPG if the\n # commit step will be skipped (fork PR, default branch, or secret unset).\n if: >\n inputs.enable-auto-commit == true &&\n github.event.pull_request != null &&\n github.event.pull_request.head.repo.full_name == github.repository &&\n github.ref_name != github.event.repository.default_branch &&\n env.GPG_KEY_SET == 'true'\n with:\n git_user_signingkey: true\n git_commit_gpgsign: true\n GPG_PRIVATE_KEY: ${{ secrets.SUPER_LINTER_GPG_PRIVATE_KEY }}\n PASSPHRASE: ${{ secrets.SUPER_LINTER_GPG_PASSPHRASE }}\n\n - uses: stefanzweifel/git-auto-commit-action@4a55954c782fc1ea30b9056cd3e7a2b40ca8887d # v7.2.0\n name: Commit and push linting fixes\n if: >\n inputs.enable-auto-commit == true &&\n github.event.pull_request != null &&\n github.event.pull_request.head.repo.full_name == github.repository &&\n github.ref_name != github.event.repository.default_branch &&\n env.GPG_KEY_SET == 'true'\n with:\n branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}\n commit_message: \"chore: fix linting issues\\n\\nSigned-off-by: super-linter <super-linter@super-linter.dev>\"\n commit_options: \"--no-verify\"\n commit_user_name: super-linter\n commit_user_email: super-linter@super-linter.dev\n";
|
|
865
|
+
//#endregion
|
|
866
|
+
//#region src/templates/workflows/release.yml
|
|
867
|
+
var release_default$1 = "name: Release\n\n# Semantic-release with OIDC Trusted Publishing — no NPM_TOKEN required.\n# The calling repo must have a .releaserc.json that configures branches,\n# plugins, and any publish options. npm@11+ is installed to support OIDC.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n run-build:\n description: Run `pnpm build` before releasing\n type: boolean\n required: false\n default: true\n secrets:\n SYNC_TOKEN:\n description: >\n Optional PAT with Contents write access. Required when the default\n branch is protected by a ruleset — github.token cannot push through\n rulesets, but a PAT with admin bypass can. Falls back to github.token.\n required: false\n\njobs:\n release:\n name: Semantic release\n permissions:\n contents: write\n id-token: write\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n # Do not cancel in-progress releases — a partial release is worse than a slow one.\n concurrency:\n group: release-${{ github.ref }}\n cancel-in-progress: false\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n fetch-depth: 0\n # Use SYNC_TOKEN when available — git push (tags, release commits)\n # uses the checkout credential, not GITHUB_TOKEN env var. The\n # built-in github.token cannot push through branch protection rulesets.\n token: ${{ secrets.SYNC_TOKEN || github.token }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - name: Configure git identity\n run: |\n GIT_NAME=$(gh api user --jq .name 2>/dev/null || echo \"github-actions[bot]\")\n GIT_EMAIL=$(gh api user --jq '\"\\(.id)+\\(.login)@users.noreply.github.com\"' 2>/dev/null || echo \"41898282+github-actions[bot]@users.noreply.github.com\")\n git config --global user.name \"$GIT_NAME\"\n git config --global user.email \"$GIT_EMAIL\"\n git config --global format.signoff true\n env:\n GH_TOKEN: ${{ secrets.SYNC_TOKEN || github.token }}\n\n - run: npm install -g npm@11 sigstore\n name: Upgrade npm for OIDC support\n # sigstore is required by libnpmpublish/provenance.js at module parse\n # time — before any config takes effect. Some npm 11.x builds stopped\n # bundling it; installing it globally into the same prefix ensures it\n # resolves regardless of npm version. (Discovered 2026-07-09.)\n\n - run: pnpm build\n name: Build\n if: ${{ inputs.run-build == true }}\n\n - run: npx semantic-release\n name: Release\n env:\n # Prefer SYNC_TOKEN (a PAT with Contents write) when available —\n # the built-in github.token cannot push to protected default branches\n # because rulesets block non-PAT pushes. Falls back to github.token\n # for repos without branch protection.\n GITHUB_TOKEN: ${{ secrets.SYNC_TOKEN || github.token }}\n NPM_CONFIG_PROVENANCE: true\n";
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region src/templates/workflows/review.yml
|
|
870
|
+
var review_default$1 = "name: Review\n\n# ReviewDog is the annotation layer — posts inline PR diff annotations.\n# Runs on pull_request only: inline annotations require PR context,\n# and branch protection ensures all changes go through PRs anyway.\n# super-linter (lint.yml) is the CI gate covering push + PR events.\n# Gitleaks and YAML are intentionally duplicated: super-linter gates\n# merges; ReviewDog surfaces exact line annotations in the PR diff.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n\nconcurrency:\n group: review-${{ github.workflow }}-${{ github.ref }}\n cancel-in-progress: true\n\njobs:\n reviewdog:\n name: Review PRs\n runs-on: ubuntu-latest\n timeout-minutes: 20\n permissions:\n contents: read\n checks: write\n pull-requests: write\n\n steps:\n - name: Checkout repository\n uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n with:\n fetch-depth: 0\n\n - name: Setup\n if: ${{ hashFiles('pnpm-lock.yaml') != '' }}\n uses: theholocron/.github/.github/actions/setup@main\n\n - name: Install ReviewDog\n uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1\n with:\n reviewdog_version: latest\n\n # Detect which tools are relevant for this repo, excluding node_modules.\n # hashFiles('**/*') recurses into node_modules/.pnpm and produces false\n # positives for repos that don't own those file types.\n # -print -quit stops find after the first match without a pipe, avoiding\n # the SIGPIPE/pipefail exit-141 that find|head-1 triggers under\n # GitHub Actions' default bash --noprofile --norc -e -o pipefail mode.\n - name: Detect project features\n id: detect\n shell: bash\n run: |\n has() { find . -not -path '*/node_modules/*' -name \"$1\" -print -quit 2>/dev/null | grep -q .; }\n has_ext() { find . -not -path '*/node_modules/*' -name \"$1\" -print -quit 2>/dev/null | grep -q .; }\n { { has 'eslint.config.js' || has 'eslint.config.mjs' || has 'eslint.config.cjs' || \\\n has 'eslint.config.ts' || has '.eslintrc' || has '.eslintrc.js' || \\\n has '.eslintrc.cjs' || has '.eslintrc.json' || has '.eslintrc.yaml' || \\\n has '.eslintrc.yml'; } && grep -qF '\"eslint\":' package.json 2>/dev/null; } && echo \"eslint=true\" >> \"$GITHUB_OUTPUT\" || echo \"eslint=false\" >> \"$GITHUB_OUTPUT\"\n { has 'tsconfig.json' && grep -qF '\"typescript\":' package.json 2>/dev/null; } && echo \"tsconfig=true\" >> \"$GITHUB_OUTPUT\" || echo \"tsconfig=false\" >> \"$GITHUB_OUTPUT\"\n has_ext '*.sh' && echo \"shell=true\" >> \"$GITHUB_OUTPUT\" || echo \"shell=false\" >> \"$GITHUB_OUTPUT\"\n has 'Dockerfile' || has_ext '*.Dockerfile' || has 'Containerfile' && \\\n echo \"docker=true\" >> \"$GITHUB_OUTPUT\" || echo \"docker=false\" >> \"$GITHUB_OUTPUT\"\n has_ext '.env*' && echo \"dotenv=true\" >> \"$GITHUB_OUTPUT\" || echo \"dotenv=false\" >> \"$GITHUB_OUTPUT\"\n has_ext '*.md' && echo \"markdown=true\" >> \"$GITHUB_OUTPUT\" || echo \"markdown=false\" >> \"$GITHUB_OUTPUT\"\n\n #\n # Always applicable\n #\n\n - name: Gitleaks (secrets)\n uses: reviewdog/action-gitleaks@2b7b5685e3e3eecddab5d30cfa04f18123031421 # v1\n with:\n reporter: github-pr-check\n gitleaks_flags: --log-opts=${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}\n\n - name: YamlLint\n if: ${{ hashFiles('yamllint.config.yml') != '' }}\n uses: reviewdog/action-yamllint@b5f7217d8c815ae374d1d55840d5e569d82f01f0 # v1\n with:\n reporter: github-pr-check\n yamllint_flags: -c ${{ github.workspace }}/yamllint.config.yml ${{ github.workspace }}\n\n - name: ActionLint (GitHub Actions)\n if: ${{ hashFiles('.github/workflows/*.yml', '.github/workflows/*.yaml') != '' }}\n uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1\n with:\n reporter: github-pr-check\n\n #\n # TypeScript / JavaScript\n #\n\n - name: ESLint\n if: steps.detect.outputs.eslint == 'true'\n uses: reviewdog/action-eslint@556a3fdaf8b4201d4d74d406013386aa4f7dab96 # v1.34.0\n with:\n reporter: github-pr-check\n eslint_flags: .\n\n - name: TypeScript\n if: steps.detect.outputs.tsconfig == 'true'\n uses: EPMatt/reviewdog-action-tsc@63d923a3c5b4497671940b8874f58a404e2351b5 # v1\n with:\n reporter: github-pr-check\n\n #\n # Shell\n #\n\n - name: ShellCheck\n if: steps.detect.outputs.shell == 'true'\n uses: reviewdog/action-shellcheck@4c07458293ac342d477251099501a718ae5ef86e # v1\n with:\n reporter: github-pr-check\n fail_level: none\n\n #\n # Docker\n #\n\n - name: Hadolint\n if: steps.detect.outputs.docker == 'true'\n uses: reviewdog/action-hadolint@1b2cfa6ba72072ad35158d7ff3aa49bbdc03506d # v1\n with:\n reporter: github-pr-check\n fail_level: none\n\n #\n # Environment files\n #\n\n - name: dotenv-linter\n if: steps.detect.outputs.dotenv == 'true'\n uses: dotenv-linter/action-dotenv-linter@afde61cfda2ecffe7bea35837b6f20b956c88689 # v3.0.0\n with:\n reporter: github-code-suggestions\n\n #\n # Documentation\n #\n\n - name: Alex (inclusive language)\n if: steps.detect.outputs.markdown == 'true'\n uses: reviewdog/action-alex@347481655add010a2ae302df34b57c9bcfa0d6e4 # v1\n with:\n reporter: github-pr-check\n";
|
|
871
|
+
//#endregion
|
|
872
|
+
//#region src/templates/workflows/stale.yml
|
|
873
|
+
var stale_default$1 = "name: Stale\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n days-before-stale:\n description: Days of inactivity before an issue is marked stale\n type: number\n required: false\n default: 30\n days-before-close:\n description: Days of inactivity after stale label before closing\n type: number\n required: false\n default: 5\n\njobs:\n stale:\n name: Mark stale issues and pull requests\n permissions:\n contents: write\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 10\n steps:\n - uses: actions/stale@1e223db275d687790206a7acac4d1a11bd6fe629 # v10.4.0\n name: Run Stale\n with:\n close-issue-message: >\n This issue was closed because it has been stalled for\n ${{ inputs.days-before-close }} days with no activity.\n days-before-close: ${{ inputs.days-before-close }}\n days-before-stale: ${{ inputs.days-before-stale }}\n exempt-all-pr-milestones: true\n stale-issue-label: wontfix\n stale-issue-message: >\n This issue is stale because it has been open ${{ inputs.days-before-stale }}\n days with no activity. Remove the stale label or comment, or this will be\n closed in ${{ inputs.days-before-close }} days.\n stale-pr-label: wontfix\n stale-pr-message: >\n This PR is stale because it has been open ${{ inputs.days-before-stale }}\n days with no activity. Remove the stale label or comment, or this will be\n closed in ${{ inputs.days-before-close }} days.\n";
|
|
874
|
+
//#endregion
|
|
875
|
+
//#region src/templates/workflows/sync-github.yml
|
|
876
|
+
var sync_github_default$1 = "name: Sync GitHub Templates\n\n# Builds the holocron CLI from source and pushes updated workflow templates\n# and composite actions to downstream .github repos. Runs whenever the\n# template source files change on main or alpha.\n#\n# Secrets required:\n# SYNC_TOKEN — fine-grained PAT (resource owner: org) with:\n# Contents: Read and write (git trees, blobs, refs)\n# Pull requests: Read and write (open sync PR)\n# Workflows: Read and write (write .github/workflows/*.yml)\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n primary-repo:\n description: >\n Primary .github repo — receives composite actions, reusable workflows,\n and thin-caller templates. Requires a PR (branch protection assumed).\n type: string\n required: false\n default: theholocron/.github\n secondary-repos:\n description: >\n Space-separated list of secondary repos (reusable workflows + thin\n callers only, no composite actions). Changes are delivered via pull\n request, same as the primary repo.\n type: string\n required: false\n default: \"\"\n sync-branch:\n description: Branch name used for the primary and secondary repo PRs\n type: string\n required: false\n default: chore/sync-templates\n secrets:\n SYNC_TOKEN:\n required: true\n\njobs:\n sync:\n name: Sync templates\n runs-on: ubuntu-latest\n timeout-minutes: 15\n permissions:\n contents: read\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm build\n name: Build CLI\n\n - name: Validate generated workflows\n run: |\n node packages/cli/dist/cli.mjs sync-github \\\n --repo \"$PRIMARY_REPO\" \\\n --output-dir /tmp/sync-validate\n curl -fsSL https://github.com/rhysd/actionlint/releases/download/v1.7.7/actionlint_1.7.7_linux_amd64.tar.gz \\\n | tar -xz -C /tmp actionlint\n /tmp/actionlint /tmp/sync-validate/.github/workflows/*.yml\n env:\n PRIMARY_REPO: ${{ inputs.primary-repo }}\n\n - name: Sync primary repo (PR)\n run: |\n GIT_NAME=$(gh api user --jq .name 2>/dev/null || echo \"github-actions[bot]\")\n GIT_EMAIL=$(gh api user --jq '\"\\(.id)+\\(.login)@users.noreply.github.com\"' 2>/dev/null || echo \"41898282+github-actions[bot]@users.noreply.github.com\")\n COMMIT_MSG=\"chore: sync from theholocron/holocron\"$'\\n\\n'\"Signed-off-by: $GIT_NAME <$GIT_EMAIL>\"\n node packages/cli/dist/cli.mjs sync-github \\\n --repo \"$PRIMARY_REPO\" \\\n --branch \"$SYNC_BRANCH\" \\\n --pr \\\n --message \"$COMMIT_MSG\"\n env:\n GITHUB_TOKEN: ${{ secrets.SYNC_TOKEN }}\n GH_TOKEN: ${{ secrets.SYNC_TOKEN }}\n PRIMARY_REPO: ${{ inputs.primary-repo }}\n SYNC_BRANCH: ${{ inputs.sync-branch }}\n\n - name: Sync secondary repos (PR)\n if: ${{ inputs.secondary-repos != '' }}\n run: |\n GIT_NAME=$(gh api user --jq .name 2>/dev/null || echo \"github-actions[bot]\")\n GIT_EMAIL=$(gh api user --jq '\"\\(.id)+\\(.login)@users.noreply.github.com\"' 2>/dev/null || echo \"41898282+github-actions[bot]@users.noreply.github.com\")\n COMMIT_MSG=\"chore: sync from theholocron/holocron\"$'\\n\\n'\"Signed-off-by: $GIT_NAME <$GIT_EMAIL>\"\n for repo in $SECONDARY_REPOS; do\n node packages/cli/dist/cli.mjs sync-github \\\n --repo \"$repo\" \\\n --branch \"$SYNC_BRANCH\" \\\n --pr \\\n --message \"$COMMIT_MSG\"\n done\n env:\n GITHUB_TOKEN: ${{ secrets.SYNC_TOKEN }}\n GH_TOKEN: ${{ secrets.SYNC_TOKEN }}\n SECONDARY_REPOS: ${{ inputs.secondary-repos }}\n SYNC_BRANCH: ${{ inputs.sync-branch }}\n";
|
|
877
|
+
//#endregion
|
|
878
|
+
//#region src/templates/workflows/test.yml
|
|
879
|
+
var test_default$1 = "name: Test\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n CODECOV_TOKEN:\n required: false\n\njobs:\n unit:\n name: Run tests and collect coverage\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n fetch-depth: 0\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm test -- --coverage\n name: Run tests with coverage\n\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload coverage to Codecov\n with:\n token: ${{ secrets.CODECOV_TOKEN }}\n\n - uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1\n name: Upload test results to Codecov\n if: ${{ !cancelled() }}\n with:\n token: ${{ secrets.CODECOV_TOKEN }}\n files: '**/test-report.junit.xml'\n";
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region src/templates/workflows/typecheck.yml
|
|
882
|
+
var typecheck_default$1 = "name: Typecheck\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n\njobs:\n typecheck:\n name: tsc --noEmit\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 10\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm typecheck\n name: Type check\n";
|
|
883
|
+
//#endregion
|
|
839
884
|
//#region src/templates/index.ts
|
|
840
885
|
/**
|
|
841
886
|
* All reusable workflow and composite action content bundled as string
|
|
842
887
|
* constants so the CLI can push them to theholocron/.github without
|
|
843
888
|
* needing filesystem access at runtime.
|
|
844
889
|
*
|
|
845
|
-
*
|
|
846
|
-
*
|
|
890
|
+
* Content lives in standalone .yml files; the rawYml rollup plugin
|
|
891
|
+
* inlines them as string exports at build time.
|
|
847
892
|
*/
|
|
848
893
|
const ACTIONS = {
|
|
849
|
-
"setup/action":
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
inputs:
|
|
854
|
-
node-version:
|
|
855
|
-
description: Node.js version
|
|
856
|
-
required: false
|
|
857
|
-
default: "22.x"
|
|
858
|
-
|
|
859
|
-
runs:
|
|
860
|
-
using: composite
|
|
861
|
-
|
|
862
|
-
steps:
|
|
863
|
-
- uses: theholocron/.github/.github/actions/setup-node@main
|
|
864
|
-
with:
|
|
865
|
-
node-version: \${{ inputs.node-version }}
|
|
866
|
-
|
|
867
|
-
- uses: theholocron/.github/.github/actions/install@main
|
|
868
|
-
`,
|
|
869
|
-
"install/action": `\
|
|
870
|
-
name: Install dependencies
|
|
871
|
-
description: Install project dependencies with pnpm frozen lockfile.
|
|
872
|
-
|
|
873
|
-
runs:
|
|
874
|
-
using: composite
|
|
875
|
-
|
|
876
|
-
steps:
|
|
877
|
-
- name: Install dependencies
|
|
878
|
-
if: \${{ hashFiles('pnpm-lock.yaml') != '' }}
|
|
879
|
-
shell: bash
|
|
880
|
-
run: pnpm install --frozen-lockfile
|
|
881
|
-
`,
|
|
882
|
-
"setup-node/action": `\
|
|
883
|
-
name: Setup Node
|
|
884
|
-
description: Install pnpm and Node.js with pnpm dependency caching.
|
|
885
|
-
|
|
886
|
-
inputs:
|
|
887
|
-
node-version:
|
|
888
|
-
description: Node.js version
|
|
889
|
-
required: false
|
|
890
|
-
default: "22.x"
|
|
891
|
-
|
|
892
|
-
runs:
|
|
893
|
-
using: composite
|
|
894
|
-
|
|
895
|
-
steps:
|
|
896
|
-
- name: Setup pnpm
|
|
897
|
-
if: \${{ hashFiles('pnpm-lock.yaml') != '' }}
|
|
898
|
-
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
|
|
899
|
-
|
|
900
|
-
- name: Setup Node.js
|
|
901
|
-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
902
|
-
with:
|
|
903
|
-
node-version: \${{ hashFiles('.node-version') != '' && '' || inputs.node-version }}
|
|
904
|
-
node-version-file: \${{ hashFiles('.node-version') != '' && '.node-version' || '' }}
|
|
905
|
-
cache: \${{ hashFiles('pnpm-lock.yaml') != '' && 'pnpm' || '' }}
|
|
906
|
-
|
|
907
|
-
- name: Add node_modules/.bin to PATH
|
|
908
|
-
shell: bash
|
|
909
|
-
run: echo "$GITHUB_WORKSPACE/node_modules/.bin" >> $GITHUB_PATH
|
|
910
|
-
`
|
|
894
|
+
"setup/action": setup_default,
|
|
895
|
+
"install/action": install_default,
|
|
896
|
+
"setup-node/action": setup_node_default
|
|
911
897
|
};
|
|
912
898
|
const REUSABLE_WORKFLOWS = {
|
|
913
|
-
audit:
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
CODECOV_TOKEN:
|
|
926
|
-
required: false
|
|
927
|
-
|
|
928
|
-
jobs:
|
|
929
|
-
bundle-size:
|
|
930
|
-
name: Audit the bundle size
|
|
931
|
-
permissions:
|
|
932
|
-
contents: read
|
|
933
|
-
runs-on: ubuntu-latest
|
|
934
|
-
timeout-minutes: 15
|
|
935
|
-
concurrency:
|
|
936
|
-
group: audit-\${{ github.ref }}
|
|
937
|
-
cancel-in-progress: true
|
|
938
|
-
steps:
|
|
939
|
-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
940
|
-
name: Checkout repository
|
|
941
|
-
with:
|
|
942
|
-
fetch-depth: 0
|
|
943
|
-
|
|
944
|
-
- uses: theholocron/.github/.github/actions/setup@main
|
|
945
|
-
name: Setup
|
|
946
|
-
|
|
947
|
-
- run: eval "$BUILD_SCRIPT"
|
|
948
|
-
name: Build and upload bundle stats
|
|
949
|
-
env:
|
|
950
|
-
BUILD_SCRIPT: \${{ inputs.build-script }}
|
|
951
|
-
CODECOV_TOKEN: \${{ secrets.CODECOV_TOKEN }}
|
|
952
|
-
`,
|
|
953
|
-
bookkeeping: `\
|
|
954
|
-
name: Bookkeeping
|
|
955
|
-
|
|
956
|
-
on: # yamllint disable-line rule:truthy
|
|
957
|
-
workflow_call:
|
|
958
|
-
inputs:
|
|
959
|
-
configuration-path:
|
|
960
|
-
description: Path to the labeler configuration file in the calling repo
|
|
961
|
-
type: string
|
|
962
|
-
required: false
|
|
963
|
-
default: .github/labeler.yml
|
|
964
|
-
|
|
965
|
-
jobs:
|
|
966
|
-
label:
|
|
967
|
-
name: Apply Labels
|
|
968
|
-
permissions:
|
|
969
|
-
contents: read
|
|
970
|
-
issues: write
|
|
971
|
-
pull-requests: write
|
|
972
|
-
runs-on: ubuntu-latest
|
|
973
|
-
timeout-minutes: 5
|
|
974
|
-
concurrency:
|
|
975
|
-
group: bookkeeping-\${{ github.event.pull_request.number || github.event.issue.number }}
|
|
976
|
-
cancel-in-progress: true
|
|
977
|
-
steps:
|
|
978
|
-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
979
|
-
with:
|
|
980
|
-
sparse-checkout: \${{ inputs.configuration-path || '.github/labeler.yml' }}
|
|
981
|
-
sparse-checkout-cone-mode: false
|
|
982
|
-
|
|
983
|
-
- uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4
|
|
984
|
-
if: \${{ hashFiles(inputs.configuration-path || '.github/labeler.yml') != '' }}
|
|
985
|
-
# v3.4 bundles Node 20; allow it to run under Actions' current default.
|
|
986
|
-
env:
|
|
987
|
-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
|
988
|
-
with:
|
|
989
|
-
# Fall back to default path when triggered directly (not via workflow_call)
|
|
990
|
-
# because inputs.* defaults only apply on workflow_call events.
|
|
991
|
-
configuration-path: \${{ inputs.configuration-path || '.github/labeler.yml' }}
|
|
992
|
-
include-title: 1
|
|
993
|
-
include-body: 0
|
|
994
|
-
sync-labels: 1
|
|
995
|
-
enable-versioned-regex: 0
|
|
996
|
-
repo-token: \${{ github.token }}
|
|
997
|
-
`,
|
|
998
|
-
codeql: `\
|
|
999
|
-
name: CodeQL
|
|
1000
|
-
|
|
1001
|
-
on: # yamllint disable-line rule:truthy
|
|
1002
|
-
workflow_call:
|
|
1003
|
-
inputs:
|
|
1004
|
-
language:
|
|
1005
|
-
description: CodeQL language to analyze
|
|
1006
|
-
type: string
|
|
1007
|
-
required: false
|
|
1008
|
-
default: javascript-typescript
|
|
1009
|
-
|
|
1010
|
-
jobs:
|
|
1011
|
-
analyze:
|
|
1012
|
-
name: Analyze (\${{ inputs.language }})
|
|
1013
|
-
permissions:
|
|
1014
|
-
actions: read
|
|
1015
|
-
contents: read
|
|
1016
|
-
security-events: write
|
|
1017
|
-
runs-on: ubuntu-latest
|
|
1018
|
-
timeout-minutes: 45
|
|
1019
|
-
# Do not cancel in-progress security scans.
|
|
1020
|
-
concurrency:
|
|
1021
|
-
group: codeql-\${{ github.ref }}
|
|
1022
|
-
cancel-in-progress: false
|
|
1023
|
-
steps:
|
|
1024
|
-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
1025
|
-
name: Checkout repository
|
|
1026
|
-
|
|
1027
|
-
- uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
|
|
1028
|
-
name: Initialize CodeQL
|
|
1029
|
-
with:
|
|
1030
|
-
languages: \${{ inputs.language }}
|
|
1031
|
-
|
|
1032
|
-
- uses: github/codeql-action/autobuild@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
|
|
1033
|
-
name: Autobuild
|
|
1034
|
-
|
|
1035
|
-
- uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
|
|
1036
|
-
name: Analyze
|
|
1037
|
-
with:
|
|
1038
|
-
category: /language:\${{ inputs.language }}
|
|
1039
|
-
`,
|
|
1040
|
-
dependencies: `\
|
|
1041
|
-
name: Dependencies
|
|
1042
|
-
|
|
1043
|
-
on: # yamllint disable-line rule:truthy
|
|
1044
|
-
workflow_call:
|
|
1045
|
-
secrets:
|
|
1046
|
-
merge-token:
|
|
1047
|
-
description: >
|
|
1048
|
-
Optional privileged token for auto-merge. Falls back to GITHUB_TOKEN.
|
|
1049
|
-
Required when branch protection enforces required reviews — GITHUB_TOKEN
|
|
1050
|
-
cannot approve its own PRs.
|
|
1051
|
-
required: false
|
|
1052
|
-
|
|
1053
|
-
jobs:
|
|
1054
|
-
dependabot:
|
|
1055
|
-
name: Update the dependencies
|
|
1056
|
-
permissions:
|
|
1057
|
-
contents: write
|
|
1058
|
-
pull-requests: write
|
|
1059
|
-
runs-on: ubuntu-latest
|
|
1060
|
-
timeout-minutes: 5
|
|
1061
|
-
concurrency:
|
|
1062
|
-
group: dependencies-\${{ github.event.pull_request.number }}
|
|
1063
|
-
cancel-in-progress: true
|
|
1064
|
-
if: github.event.pull_request.user.login == 'dependabot[bot]'
|
|
1065
|
-
steps:
|
|
1066
|
-
- uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
|
|
1067
|
-
name: Fetch Dependabot metadata
|
|
1068
|
-
id: metadata
|
|
1069
|
-
|
|
1070
|
-
- run: gh pr merge --auto --squash "$PR_URL"
|
|
1071
|
-
# --squash is intentional: repo protection sets allow_merge_commit: false,
|
|
1072
|
-
# so --merge would fail on any repo using the standard preset.
|
|
1073
|
-
name: Enable auto-merge for Dependabot PRs
|
|
1074
|
-
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
|
|
1075
|
-
env:
|
|
1076
|
-
PR_URL: \${{ github.event.pull_request.html_url }}
|
|
1077
|
-
GH_TOKEN: \${{ secrets.merge-token || github.token }}
|
|
1078
|
-
`,
|
|
1079
|
-
greetings: `\
|
|
1080
|
-
name: Greetings
|
|
1081
|
-
|
|
1082
|
-
on: # yamllint disable-line rule:truthy
|
|
1083
|
-
workflow_call:
|
|
1084
|
-
|
|
1085
|
-
jobs:
|
|
1086
|
-
greeting:
|
|
1087
|
-
name: Greet first-time contributors
|
|
1088
|
-
permissions:
|
|
1089
|
-
issues: write
|
|
1090
|
-
pull-requests: write
|
|
1091
|
-
runs-on: ubuntu-latest
|
|
1092
|
-
timeout-minutes: 5
|
|
1093
|
-
# Group by the issue/PR number so duplicate events don't race each other.
|
|
1094
|
-
concurrency:
|
|
1095
|
-
group: greetings-\${{ github.event.issue.number || github.event.pull_request.number }}
|
|
1096
|
-
cancel-in-progress: false
|
|
1097
|
-
steps:
|
|
1098
|
-
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
1099
|
-
name: Greet on first contribution
|
|
1100
|
-
with:
|
|
1101
|
-
script: |
|
|
1102
|
-
// Only greet on the initial open — ignore synchronize, reopened, etc.
|
|
1103
|
-
if (context.payload.action !== 'opened') return;
|
|
1104
|
-
|
|
1105
|
-
const actor = context.actor;
|
|
1106
|
-
const { owner, repo } = context.repo;
|
|
1107
|
-
|
|
1108
|
-
// Payload inspection is more reliable than context.eventName for detecting
|
|
1109
|
-
// whether this is an issue vs. PR event — works regardless of how GitHub
|
|
1110
|
-
// propagates event names through workflow_call chains.
|
|
1111
|
-
const isIssue = !!context.payload.issue && !context.payload.pull_request;
|
|
1112
|
-
// listForRepo returns both issues and PRs (GitHub treats PRs as issues),
|
|
1113
|
-
// sorted newest-first. Filter by type to track first-issue and first-PR
|
|
1114
|
-
// independently, and avoid search-index eventual-consistency lag.
|
|
1115
|
-
const { data: recent } = await github.rest.issues.listForRepo({
|
|
1116
|
-
owner, repo,
|
|
1117
|
-
creator: actor,
|
|
1118
|
-
state: 'all',
|
|
1119
|
-
per_page: 100
|
|
1120
|
-
});
|
|
1121
|
-
|
|
1122
|
-
const sameType = recent.filter(item =>
|
|
1123
|
-
isIssue ? !item.pull_request : !!item.pull_request
|
|
1124
|
-
);
|
|
1125
|
-
|
|
1126
|
-
if (sameType.length !== 1) return;
|
|
1127
|
-
const body = isIssue
|
|
1128
|
-
? \`Hey @\${actor}!\\n\\nWe really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we are a limited number of volunteers, so it is possible that this will not be addressed as swiftly.\\n\\nYour patience is much appreciated and we will get back to you as quickly as possible.\`
|
|
1129
|
-
: \`Hey @\${actor}!\\n\\nWe really appreciate you taking the time to help out with this PR. The collaborators on this project attempt to help as many people as possible, but we are a limited number of volunteers, so it is possible that this will not be addressed as swiftly.\\n\\nYour patience is much appreciated and we will get back to you as quickly as possible.\`;
|
|
1130
|
-
|
|
1131
|
-
await github.rest.issues.createComment({
|
|
1132
|
-
owner,
|
|
1133
|
-
repo,
|
|
1134
|
-
issue_number: context.issue.number,
|
|
1135
|
-
body
|
|
1136
|
-
});
|
|
1137
|
-
`,
|
|
1138
|
-
lint: `\
|
|
1139
|
-
name: Lint
|
|
1140
|
-
|
|
1141
|
-
on: # yamllint disable-line rule:truthy
|
|
1142
|
-
workflow_call:
|
|
1143
|
-
inputs:
|
|
1144
|
-
prettier-config:
|
|
1145
|
-
type: string
|
|
1146
|
-
required: false
|
|
1147
|
-
default: prettier.config.js
|
|
1148
|
-
yaml-config:
|
|
1149
|
-
type: string
|
|
1150
|
-
required: false
|
|
1151
|
-
default: yamllint.config.yml
|
|
1152
|
-
enable-auto-commit:
|
|
1153
|
-
description: Auto-commit super-linter fixes via GPG-signed commit
|
|
1154
|
-
type: boolean
|
|
1155
|
-
required: false
|
|
1156
|
-
default: false
|
|
1157
|
-
secrets:
|
|
1158
|
-
SUPER_LINTER_GPG_PRIVATE_KEY:
|
|
1159
|
-
required: false
|
|
1160
|
-
SUPER_LINTER_GPG_PASSPHRASE:
|
|
1161
|
-
required: false
|
|
1162
|
-
|
|
1163
|
-
jobs:
|
|
1164
|
-
super-lint:
|
|
1165
|
-
name: Lint entire codebase
|
|
1166
|
-
permissions:
|
|
1167
|
-
contents: write
|
|
1168
|
-
statuses: write
|
|
1169
|
-
runs-on: ubuntu-latest
|
|
1170
|
-
timeout-minutes: 30
|
|
1171
|
-
env:
|
|
1172
|
-
GPG_KEY_SET: \${{ secrets.SUPER_LINTER_GPG_PRIVATE_KEY != '' }}
|
|
1173
|
-
steps:
|
|
1174
|
-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
1175
|
-
name: Checkout repository
|
|
1176
|
-
with:
|
|
1177
|
-
fetch-depth: 0
|
|
1178
|
-
token: \${{ github.token }}
|
|
1179
|
-
|
|
1180
|
-
- uses: theholocron/.github/.github/actions/setup@main
|
|
1181
|
-
name: Setup
|
|
1182
|
-
if: \${{ hashFiles('pnpm-lock.yaml') != '' }}
|
|
1183
|
-
|
|
1184
|
-
- uses: super-linter/super-linter/slim@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0
|
|
1185
|
-
name: Run Super Linter
|
|
1186
|
-
env:
|
|
1187
|
-
GITHUB_TOKEN: \${{ github.token }}
|
|
1188
|
-
DEFAULT_BRANCH: \${{ github.event.pull_request.base.ref || github.event.repository.default_branch }}
|
|
1189
|
-
ANNOTATE_ONLY: true
|
|
1190
|
-
DISABLE_COMMENTS: false
|
|
1191
|
-
IGNORE_GITIGNORED_FILES: true
|
|
1192
|
-
LINTER_RULES_PATH: /
|
|
1193
|
-
EDITORCONFIG_FILE_NAME: ".editorconfig-checker.json"
|
|
1194
|
-
FIX_ENV: true
|
|
1195
|
-
FIX_GRAPHQL_PRETTIER: true
|
|
1196
|
-
FIX_HTML_PRETTIER: true
|
|
1197
|
-
FIX_JAVASCRIPT_PRETTIER: true
|
|
1198
|
-
FIX_JSX_PRETTIER: true
|
|
1199
|
-
FIX_MARKDOWN_PRETTIER: true
|
|
1200
|
-
FIX_TSX: true
|
|
1201
|
-
FIX_TYPESCRIPT_PRETTIER: true
|
|
1202
|
-
PRETTIER_CONFIG: \${{ inputs.prettier-config }}
|
|
1203
|
-
VALIDATE_DOCKERFILE: true
|
|
1204
|
-
VALIDATE_EDITORCONFIG: true
|
|
1205
|
-
VALIDATE_ENV: true
|
|
1206
|
-
VALIDATE_GIT_COMMITLINT: true
|
|
1207
|
-
VALIDATE_GIT_MERGE_CONFLICT_MARKERS: true
|
|
1208
|
-
VALIDATE_GITHUB_ACTIONS: true
|
|
1209
|
-
VALIDATE_GITLEAKS: true
|
|
1210
|
-
VALIDATE_GRAPHQL_PRETTIER: true
|
|
1211
|
-
VALIDATE_HTML_PRETTIER: true
|
|
1212
|
-
VALIDATE_JAVASCRIPT_PRETTIER: true
|
|
1213
|
-
VALIDATE_JSX_PRETTIER: true
|
|
1214
|
-
VALIDATE_MARKDOWN_PRETTIER: true
|
|
1215
|
-
VALIDATE_TSX: true
|
|
1216
|
-
VALIDATE_TYPESCRIPT_PRETTIER: true
|
|
1217
|
-
VALIDATE_YAML: true
|
|
1218
|
-
YAML_CONFIG_FILE: \${{ inputs.yaml-config }}
|
|
1219
|
-
|
|
1220
|
-
- uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
|
|
1221
|
-
name: Import GPG Key
|
|
1222
|
-
# Conditions mirror auto-commit exactly — no point importing GPG if the
|
|
1223
|
-
# commit step will be skipped (fork PR, default branch, or secret unset).
|
|
1224
|
-
if: >
|
|
1225
|
-
inputs.enable-auto-commit == true &&
|
|
1226
|
-
github.event.pull_request != null &&
|
|
1227
|
-
github.event.pull_request.head.repo.full_name == github.repository &&
|
|
1228
|
-
github.ref_name != github.event.repository.default_branch &&
|
|
1229
|
-
env.GPG_KEY_SET == 'true'
|
|
1230
|
-
with:
|
|
1231
|
-
git_user_signingkey: true
|
|
1232
|
-
git_commit_gpgsign: true
|
|
1233
|
-
GPG_PRIVATE_KEY: \${{ secrets.SUPER_LINTER_GPG_PRIVATE_KEY }}
|
|
1234
|
-
PASSPHRASE: \${{ secrets.SUPER_LINTER_GPG_PASSPHRASE }}
|
|
1235
|
-
|
|
1236
|
-
- uses: stefanzweifel/git-auto-commit-action@4a55954c782fc1ea30b9056cd3e7a2b40ca8887d # v7.2.0
|
|
1237
|
-
name: Commit and push linting fixes
|
|
1238
|
-
if: >
|
|
1239
|
-
inputs.enable-auto-commit == true &&
|
|
1240
|
-
github.event.pull_request != null &&
|
|
1241
|
-
github.event.pull_request.head.repo.full_name == github.repository &&
|
|
1242
|
-
github.ref_name != github.event.repository.default_branch &&
|
|
1243
|
-
env.GPG_KEY_SET == 'true'
|
|
1244
|
-
with:
|
|
1245
|
-
branch: \${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
|
|
1246
|
-
commit_message: "chore: fix linting issues\\n\\nSigned-off-by: super-linter <super-linter@super-linter.dev>"
|
|
1247
|
-
commit_options: "--no-verify"
|
|
1248
|
-
commit_user_name: super-linter
|
|
1249
|
-
commit_user_email: super-linter@super-linter.dev
|
|
1250
|
-
`,
|
|
1251
|
-
release: `\
|
|
1252
|
-
name: Release
|
|
1253
|
-
|
|
1254
|
-
# Semantic-release with OIDC Trusted Publishing — no NPM_TOKEN required.
|
|
1255
|
-
# The calling repo must have a .releaserc.json that configures branches,
|
|
1256
|
-
# plugins, and any publish options. npm@11+ is installed to support OIDC.
|
|
1257
|
-
|
|
1258
|
-
on: # yamllint disable-line rule:truthy
|
|
1259
|
-
workflow_call:
|
|
1260
|
-
inputs:
|
|
1261
|
-
run-build:
|
|
1262
|
-
description: Run \`pnpm build\` before releasing
|
|
1263
|
-
type: boolean
|
|
1264
|
-
required: false
|
|
1265
|
-
default: true
|
|
1266
|
-
secrets:
|
|
1267
|
-
SYNC_TOKEN:
|
|
1268
|
-
description: >
|
|
1269
|
-
Optional PAT with Contents write access. Required when the default
|
|
1270
|
-
branch is protected by a ruleset — github.token cannot push through
|
|
1271
|
-
rulesets, but a PAT with admin bypass can. Falls back to github.token.
|
|
1272
|
-
required: false
|
|
1273
|
-
|
|
1274
|
-
jobs:
|
|
1275
|
-
release:
|
|
1276
|
-
name: Semantic release
|
|
1277
|
-
permissions:
|
|
1278
|
-
contents: write
|
|
1279
|
-
id-token: write
|
|
1280
|
-
issues: write
|
|
1281
|
-
pull-requests: write
|
|
1282
|
-
runs-on: ubuntu-latest
|
|
1283
|
-
timeout-minutes: 30
|
|
1284
|
-
# Do not cancel in-progress releases — a partial release is worse than a slow one.
|
|
1285
|
-
concurrency:
|
|
1286
|
-
group: release-\${{ github.ref }}
|
|
1287
|
-
cancel-in-progress: false
|
|
1288
|
-
steps:
|
|
1289
|
-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
1290
|
-
name: Checkout repository
|
|
1291
|
-
with:
|
|
1292
|
-
fetch-depth: 0
|
|
1293
|
-
# Use SYNC_TOKEN when available — git push (tags, release commits)
|
|
1294
|
-
# uses the checkout credential, not GITHUB_TOKEN env var. The
|
|
1295
|
-
# built-in github.token cannot push through branch protection rulesets.
|
|
1296
|
-
token: \${{ secrets.SYNC_TOKEN || github.token }}
|
|
1297
|
-
|
|
1298
|
-
- uses: theholocron/.github/.github/actions/setup@main
|
|
1299
|
-
name: Setup
|
|
1300
|
-
|
|
1301
|
-
- name: Configure git identity
|
|
1302
|
-
run: |
|
|
1303
|
-
GIT_NAME=$(gh api user --jq .name 2>/dev/null || echo "github-actions[bot]")
|
|
1304
|
-
GIT_EMAIL=$(gh api user --jq '"\\(.id)+\\(.login)@users.noreply.github.com"' 2>/dev/null || echo "41898282+github-actions[bot]@users.noreply.github.com")
|
|
1305
|
-
git config --global user.name "$GIT_NAME"
|
|
1306
|
-
git config --global user.email "$GIT_EMAIL"
|
|
1307
|
-
git config --global format.signoff true
|
|
1308
|
-
env:
|
|
1309
|
-
GH_TOKEN: \${{ secrets.SYNC_TOKEN || github.token }}
|
|
1310
|
-
|
|
1311
|
-
- run: npm install -g npm@11 sigstore
|
|
1312
|
-
name: Upgrade npm for OIDC support
|
|
1313
|
-
# sigstore is required by libnpmpublish/provenance.js at module parse
|
|
1314
|
-
# time — before any config takes effect. Some npm 11.x builds stopped
|
|
1315
|
-
# bundling it; installing it globally into the same prefix ensures it
|
|
1316
|
-
# resolves regardless of npm version. (Discovered 2026-07-09.)
|
|
1317
|
-
|
|
1318
|
-
- run: pnpm build
|
|
1319
|
-
name: Build
|
|
1320
|
-
if: \${{ inputs.run-build == true }}
|
|
1321
|
-
|
|
1322
|
-
- run: npx semantic-release
|
|
1323
|
-
name: Release
|
|
1324
|
-
env:
|
|
1325
|
-
# Prefer SYNC_TOKEN (a PAT with Contents write) when available —
|
|
1326
|
-
# the built-in github.token cannot push to protected default branches
|
|
1327
|
-
# because rulesets block non-PAT pushes. Falls back to github.token
|
|
1328
|
-
# for repos without branch protection.
|
|
1329
|
-
GITHUB_TOKEN: \${{ secrets.SYNC_TOKEN || github.token }}
|
|
1330
|
-
NPM_CONFIG_PROVENANCE: true
|
|
1331
|
-
`,
|
|
1332
|
-
review: `\
|
|
1333
|
-
name: Review
|
|
1334
|
-
|
|
1335
|
-
# ReviewDog is the annotation layer — posts inline PR diff annotations.
|
|
1336
|
-
# Runs on pull_request only: inline annotations require PR context,
|
|
1337
|
-
# and branch protection ensures all changes go through PRs anyway.
|
|
1338
|
-
# super-linter (lint.yml) is the CI gate covering push + PR events.
|
|
1339
|
-
# Gitleaks and YAML are intentionally duplicated: super-linter gates
|
|
1340
|
-
# merges; ReviewDog surfaces exact line annotations in the PR diff.
|
|
1341
|
-
|
|
1342
|
-
on: # yamllint disable-line rule:truthy
|
|
1343
|
-
workflow_call:
|
|
1344
|
-
|
|
1345
|
-
concurrency:
|
|
1346
|
-
group: review-\${{ github.workflow }}-\${{ github.ref }}
|
|
1347
|
-
cancel-in-progress: true
|
|
1348
|
-
|
|
1349
|
-
jobs:
|
|
1350
|
-
reviewdog:
|
|
1351
|
-
name: Review PRs
|
|
1352
|
-
runs-on: ubuntu-latest
|
|
1353
|
-
timeout-minutes: 20
|
|
1354
|
-
permissions:
|
|
1355
|
-
contents: read
|
|
1356
|
-
checks: write
|
|
1357
|
-
pull-requests: write
|
|
1358
|
-
|
|
1359
|
-
steps:
|
|
1360
|
-
- name: Checkout repository
|
|
1361
|
-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
1362
|
-
with:
|
|
1363
|
-
fetch-depth: 0
|
|
1364
|
-
|
|
1365
|
-
- name: Setup
|
|
1366
|
-
if: \${{ hashFiles('pnpm-lock.yaml') != '' }}
|
|
1367
|
-
uses: theholocron/.github/.github/actions/setup@main
|
|
1368
|
-
|
|
1369
|
-
- name: Install ReviewDog
|
|
1370
|
-
uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1
|
|
1371
|
-
with:
|
|
1372
|
-
reviewdog_version: latest
|
|
1373
|
-
|
|
1374
|
-
# Detect which tools are relevant for this repo, excluding node_modules.
|
|
1375
|
-
# hashFiles('**/*') recurses into node_modules/.pnpm and produces false
|
|
1376
|
-
# positives for repos that don't own those file types.
|
|
1377
|
-
# -print -quit stops find after the first match without a pipe, avoiding
|
|
1378
|
-
# the SIGPIPE/pipefail exit-141 that find|head-1 triggers under
|
|
1379
|
-
# GitHub Actions' default bash --noprofile --norc -e -o pipefail mode.
|
|
1380
|
-
- name: Detect project features
|
|
1381
|
-
id: detect
|
|
1382
|
-
shell: bash
|
|
1383
|
-
run: |
|
|
1384
|
-
has() { find . -not -path '*/node_modules/*' -name "$1" -print -quit 2>/dev/null | grep -q .; }
|
|
1385
|
-
has_ext() { find . -not -path '*/node_modules/*' -name "$1" -print -quit 2>/dev/null | grep -q .; }
|
|
1386
|
-
{ { has 'eslint.config.js' || has 'eslint.config.mjs' || has 'eslint.config.cjs' || \\
|
|
1387
|
-
has 'eslint.config.ts' || has '.eslintrc' || has '.eslintrc.js' || \\
|
|
1388
|
-
has '.eslintrc.cjs' || has '.eslintrc.json' || has '.eslintrc.yaml' || \\
|
|
1389
|
-
has '.eslintrc.yml'; } && grep -qF '"eslint":' package.json 2>/dev/null; } && echo "eslint=true" >> "$GITHUB_OUTPUT" || echo "eslint=false" >> "$GITHUB_OUTPUT"
|
|
1390
|
-
{ has 'tsconfig.json' && grep -qF '"typescript":' package.json 2>/dev/null; } && echo "tsconfig=true" >> "$GITHUB_OUTPUT" || echo "tsconfig=false" >> "$GITHUB_OUTPUT"
|
|
1391
|
-
has_ext '*.sh' && echo "shell=true" >> "$GITHUB_OUTPUT" || echo "shell=false" >> "$GITHUB_OUTPUT"
|
|
1392
|
-
has 'Dockerfile' || has_ext '*.Dockerfile' || has 'Containerfile' && \\
|
|
1393
|
-
echo "docker=true" >> "$GITHUB_OUTPUT" || echo "docker=false" >> "$GITHUB_OUTPUT"
|
|
1394
|
-
has_ext '.env*' && echo "dotenv=true" >> "$GITHUB_OUTPUT" || echo "dotenv=false" >> "$GITHUB_OUTPUT"
|
|
1395
|
-
has_ext '*.md' && echo "markdown=true" >> "$GITHUB_OUTPUT" || echo "markdown=false" >> "$GITHUB_OUTPUT"
|
|
1396
|
-
|
|
1397
|
-
#
|
|
1398
|
-
# Always applicable
|
|
1399
|
-
#
|
|
1400
|
-
|
|
1401
|
-
- name: Gitleaks (secrets)
|
|
1402
|
-
uses: reviewdog/action-gitleaks@2b7b5685e3e3eecddab5d30cfa04f18123031421 # v1
|
|
1403
|
-
with:
|
|
1404
|
-
reporter: github-pr-check
|
|
1405
|
-
gitleaks_flags: --log-opts=\${{ github.event.pull_request.base.sha }}..\${{ github.event.pull_request.head.sha }}
|
|
1406
|
-
|
|
1407
|
-
- name: YamlLint
|
|
1408
|
-
if: \${{ hashFiles('yamllint.config.yml') != '' }}
|
|
1409
|
-
uses: reviewdog/action-yamllint@b5f7217d8c815ae374d1d55840d5e569d82f01f0 # v1
|
|
1410
|
-
with:
|
|
1411
|
-
reporter: github-pr-check
|
|
1412
|
-
yamllint_flags: -c \${{ github.workspace }}/yamllint.config.yml \${{ github.workspace }}
|
|
1413
|
-
|
|
1414
|
-
- name: ActionLint (GitHub Actions)
|
|
1415
|
-
if: \${{ hashFiles('.github/workflows/*.yml', '.github/workflows/*.yaml') != '' }}
|
|
1416
|
-
uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1
|
|
1417
|
-
with:
|
|
1418
|
-
reporter: github-pr-check
|
|
1419
|
-
|
|
1420
|
-
#
|
|
1421
|
-
# TypeScript / JavaScript
|
|
1422
|
-
#
|
|
1423
|
-
|
|
1424
|
-
- name: ESLint
|
|
1425
|
-
if: steps.detect.outputs.eslint == 'true'
|
|
1426
|
-
uses: reviewdog/action-eslint@556a3fdaf8b4201d4d74d406013386aa4f7dab96 # v1.34.0
|
|
1427
|
-
with:
|
|
1428
|
-
reporter: github-pr-check
|
|
1429
|
-
eslint_flags: .
|
|
1430
|
-
|
|
1431
|
-
- name: TypeScript
|
|
1432
|
-
if: steps.detect.outputs.tsconfig == 'true'
|
|
1433
|
-
uses: EPMatt/reviewdog-action-tsc@63d923a3c5b4497671940b8874f58a404e2351b5 # v1
|
|
1434
|
-
with:
|
|
1435
|
-
reporter: github-pr-check
|
|
1436
|
-
|
|
1437
|
-
#
|
|
1438
|
-
# Shell
|
|
1439
|
-
#
|
|
1440
|
-
|
|
1441
|
-
- name: ShellCheck
|
|
1442
|
-
if: steps.detect.outputs.shell == 'true'
|
|
1443
|
-
uses: reviewdog/action-shellcheck@4c07458293ac342d477251099501a718ae5ef86e # v1
|
|
1444
|
-
with:
|
|
1445
|
-
reporter: github-pr-check
|
|
1446
|
-
fail_level: none
|
|
1447
|
-
|
|
1448
|
-
#
|
|
1449
|
-
# Docker
|
|
1450
|
-
#
|
|
1451
|
-
|
|
1452
|
-
- name: Hadolint
|
|
1453
|
-
if: steps.detect.outputs.docker == 'true'
|
|
1454
|
-
uses: reviewdog/action-hadolint@1b2cfa6ba72072ad35158d7ff3aa49bbdc03506d # v1
|
|
1455
|
-
with:
|
|
1456
|
-
reporter: github-pr-check
|
|
1457
|
-
fail_level: none
|
|
1458
|
-
|
|
1459
|
-
#
|
|
1460
|
-
# Environment files
|
|
1461
|
-
#
|
|
1462
|
-
|
|
1463
|
-
- name: dotenv-linter
|
|
1464
|
-
if: steps.detect.outputs.dotenv == 'true'
|
|
1465
|
-
uses: dotenv-linter/action-dotenv-linter@afde61cfda2ecffe7bea35837b6f20b956c88689 # v3.0.0
|
|
1466
|
-
with:
|
|
1467
|
-
reporter: github-code-suggestions
|
|
1468
|
-
|
|
1469
|
-
#
|
|
1470
|
-
# Documentation
|
|
1471
|
-
#
|
|
1472
|
-
|
|
1473
|
-
- name: Alex (inclusive language)
|
|
1474
|
-
if: steps.detect.outputs.markdown == 'true'
|
|
1475
|
-
uses: reviewdog/action-alex@347481655add010a2ae302df34b57c9bcfa0d6e4 # v1
|
|
1476
|
-
with:
|
|
1477
|
-
reporter: github-pr-check
|
|
1478
|
-
`,
|
|
1479
|
-
stale: `\
|
|
1480
|
-
name: Stale
|
|
1481
|
-
|
|
1482
|
-
on: # yamllint disable-line rule:truthy
|
|
1483
|
-
workflow_call:
|
|
1484
|
-
inputs:
|
|
1485
|
-
days-before-stale:
|
|
1486
|
-
description: Days of inactivity before an issue is marked stale
|
|
1487
|
-
type: number
|
|
1488
|
-
required: false
|
|
1489
|
-
default: 30
|
|
1490
|
-
days-before-close:
|
|
1491
|
-
description: Days of inactivity after stale label before closing
|
|
1492
|
-
type: number
|
|
1493
|
-
required: false
|
|
1494
|
-
default: 5
|
|
1495
|
-
|
|
1496
|
-
jobs:
|
|
1497
|
-
stale:
|
|
1498
|
-
name: Mark stale issues and pull requests
|
|
1499
|
-
permissions:
|
|
1500
|
-
contents: write
|
|
1501
|
-
issues: write
|
|
1502
|
-
pull-requests: write
|
|
1503
|
-
runs-on: ubuntu-latest
|
|
1504
|
-
timeout-minutes: 10
|
|
1505
|
-
steps:
|
|
1506
|
-
- uses: actions/stale@1e223db275d687790206a7acac4d1a11bd6fe629 # v10.4.0
|
|
1507
|
-
name: Run Stale
|
|
1508
|
-
with:
|
|
1509
|
-
close-issue-message: >
|
|
1510
|
-
This issue was closed because it has been stalled for
|
|
1511
|
-
\${{ inputs.days-before-close }} days with no activity.
|
|
1512
|
-
days-before-close: \${{ inputs.days-before-close }}
|
|
1513
|
-
days-before-stale: \${{ inputs.days-before-stale }}
|
|
1514
|
-
exempt-all-pr-milestones: true
|
|
1515
|
-
stale-issue-label: wontfix
|
|
1516
|
-
stale-issue-message: >
|
|
1517
|
-
This issue is stale because it has been open \${{ inputs.days-before-stale }}
|
|
1518
|
-
days with no activity. Remove the stale label or comment, or this will be
|
|
1519
|
-
closed in \${{ inputs.days-before-close }} days.
|
|
1520
|
-
stale-pr-label: wontfix
|
|
1521
|
-
stale-pr-message: >
|
|
1522
|
-
This PR is stale because it has been open \${{ inputs.days-before-stale }}
|
|
1523
|
-
days with no activity. Remove the stale label or comment, or this will be
|
|
1524
|
-
closed in \${{ inputs.days-before-close }} days.
|
|
1525
|
-
`,
|
|
1526
|
-
test: `\
|
|
1527
|
-
name: Test
|
|
1528
|
-
|
|
1529
|
-
on: # yamllint disable-line rule:truthy
|
|
1530
|
-
workflow_call:
|
|
1531
|
-
secrets:
|
|
1532
|
-
CODECOV_TOKEN:
|
|
1533
|
-
required: false
|
|
1534
|
-
|
|
1535
|
-
jobs:
|
|
1536
|
-
unit:
|
|
1537
|
-
name: Run tests and collect coverage
|
|
1538
|
-
permissions:
|
|
1539
|
-
contents: read
|
|
1540
|
-
runs-on: ubuntu-latest
|
|
1541
|
-
timeout-minutes: 15
|
|
1542
|
-
steps:
|
|
1543
|
-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
1544
|
-
name: Checkout repository
|
|
1545
|
-
with:
|
|
1546
|
-
fetch-depth: 0
|
|
1547
|
-
|
|
1548
|
-
- uses: theholocron/.github/.github/actions/setup@main
|
|
1549
|
-
name: Setup
|
|
1550
|
-
|
|
1551
|
-
- run: pnpm test -- --coverage
|
|
1552
|
-
name: Run tests with coverage
|
|
1553
|
-
|
|
1554
|
-
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
|
1555
|
-
name: Upload coverage to Codecov
|
|
1556
|
-
with:
|
|
1557
|
-
token: \${{ secrets.CODECOV_TOKEN }}
|
|
1558
|
-
|
|
1559
|
-
- uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
|
|
1560
|
-
name: Upload test results to Codecov
|
|
1561
|
-
if: \${{ !cancelled() }}
|
|
1562
|
-
with:
|
|
1563
|
-
token: \${{ secrets.CODECOV_TOKEN }}
|
|
1564
|
-
files: '**/test-report.junit.xml'
|
|
1565
|
-
`,
|
|
1566
|
-
"sync-github": `\
|
|
1567
|
-
name: Sync GitHub Templates
|
|
1568
|
-
|
|
1569
|
-
# Builds the holocron CLI from source and pushes updated workflow templates
|
|
1570
|
-
# and composite actions to downstream .github repos. Runs whenever the
|
|
1571
|
-
# template source files change on main or alpha.
|
|
1572
|
-
#
|
|
1573
|
-
# Secrets required:
|
|
1574
|
-
# SYNC_TOKEN — fine-grained PAT (resource owner: org) with:
|
|
1575
|
-
# Contents: Read and write (git trees, blobs, refs)
|
|
1576
|
-
# Pull requests: Read and write (open sync PR)
|
|
1577
|
-
# Workflows: Read and write (write .github/workflows/*.yml)
|
|
1578
|
-
|
|
1579
|
-
on: # yamllint disable-line rule:truthy
|
|
1580
|
-
workflow_call:
|
|
1581
|
-
inputs:
|
|
1582
|
-
primary-repo:
|
|
1583
|
-
description: >
|
|
1584
|
-
Primary .github repo — receives composite actions, reusable workflows,
|
|
1585
|
-
and thin-caller templates. Requires a PR (branch protection assumed).
|
|
1586
|
-
type: string
|
|
1587
|
-
required: false
|
|
1588
|
-
default: theholocron/.github
|
|
1589
|
-
secondary-repos:
|
|
1590
|
-
description: >
|
|
1591
|
-
Space-separated list of secondary repos (reusable workflows + thin
|
|
1592
|
-
callers only, no composite actions). Changes are delivered via pull
|
|
1593
|
-
request, same as the primary repo.
|
|
1594
|
-
type: string
|
|
1595
|
-
required: false
|
|
1596
|
-
default: ""
|
|
1597
|
-
sync-branch:
|
|
1598
|
-
description: Branch name used for the primary and secondary repo PRs
|
|
1599
|
-
type: string
|
|
1600
|
-
required: false
|
|
1601
|
-
default: chore/sync-templates
|
|
1602
|
-
secrets:
|
|
1603
|
-
SYNC_TOKEN:
|
|
1604
|
-
required: true
|
|
1605
|
-
|
|
1606
|
-
jobs:
|
|
1607
|
-
sync:
|
|
1608
|
-
name: Sync templates
|
|
1609
|
-
runs-on: ubuntu-latest
|
|
1610
|
-
timeout-minutes: 15
|
|
1611
|
-
permissions:
|
|
1612
|
-
contents: read
|
|
1613
|
-
steps:
|
|
1614
|
-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
1615
|
-
name: Checkout repository
|
|
1616
|
-
|
|
1617
|
-
- uses: theholocron/.github/.github/actions/setup@main
|
|
1618
|
-
name: Setup
|
|
1619
|
-
|
|
1620
|
-
- run: pnpm build
|
|
1621
|
-
name: Build CLI
|
|
1622
|
-
|
|
1623
|
-
- name: Validate generated workflows
|
|
1624
|
-
run: |
|
|
1625
|
-
node packages/cli/dist/cli.mjs sync-github \\
|
|
1626
|
-
--repo "$PRIMARY_REPO" \\
|
|
1627
|
-
--output-dir /tmp/sync-validate
|
|
1628
|
-
curl -fsSL https://github.com/rhysd/actionlint/releases/download/v1.7.7/actionlint_1.7.7_linux_amd64.tar.gz \\
|
|
1629
|
-
| tar -xz -C /tmp actionlint
|
|
1630
|
-
/tmp/actionlint /tmp/sync-validate/.github/workflows/*.yml
|
|
1631
|
-
env:
|
|
1632
|
-
PRIMARY_REPO: \${{ inputs.primary-repo }}
|
|
1633
|
-
|
|
1634
|
-
- name: Sync primary repo (PR)
|
|
1635
|
-
run: |
|
|
1636
|
-
GIT_NAME=$(gh api user --jq .name 2>/dev/null || echo "github-actions[bot]")
|
|
1637
|
-
GIT_EMAIL=$(gh api user --jq '"\\(.id)+\\(.login)@users.noreply.github.com"' 2>/dev/null || echo "41898282+github-actions[bot]@users.noreply.github.com")
|
|
1638
|
-
COMMIT_MSG="chore: sync from theholocron/holocron"$'\\n\\n'"Signed-off-by: $GIT_NAME <$GIT_EMAIL>"
|
|
1639
|
-
node packages/cli/dist/cli.mjs sync-github \\
|
|
1640
|
-
--repo "$PRIMARY_REPO" \\
|
|
1641
|
-
--branch "$SYNC_BRANCH" \\
|
|
1642
|
-
--pr \\
|
|
1643
|
-
--message "$COMMIT_MSG"
|
|
1644
|
-
env:
|
|
1645
|
-
GITHUB_TOKEN: \${{ secrets.SYNC_TOKEN }}
|
|
1646
|
-
GH_TOKEN: \${{ secrets.SYNC_TOKEN }}
|
|
1647
|
-
PRIMARY_REPO: \${{ inputs.primary-repo }}
|
|
1648
|
-
SYNC_BRANCH: \${{ inputs.sync-branch }}
|
|
1649
|
-
|
|
1650
|
-
- name: Sync secondary repos (PR)
|
|
1651
|
-
if: \${{ inputs.secondary-repos != '' }}
|
|
1652
|
-
run: |
|
|
1653
|
-
GIT_NAME=$(gh api user --jq .name 2>/dev/null || echo "github-actions[bot]")
|
|
1654
|
-
GIT_EMAIL=$(gh api user --jq '"\\(.id)+\\(.login)@users.noreply.github.com"' 2>/dev/null || echo "41898282+github-actions[bot]@users.noreply.github.com")
|
|
1655
|
-
COMMIT_MSG="chore: sync from theholocron/holocron"$'\\n\\n'"Signed-off-by: $GIT_NAME <$GIT_EMAIL>"
|
|
1656
|
-
for repo in $SECONDARY_REPOS; do
|
|
1657
|
-
node packages/cli/dist/cli.mjs sync-github \\
|
|
1658
|
-
--repo "$repo" \\
|
|
1659
|
-
--branch "$SYNC_BRANCH" \\
|
|
1660
|
-
--pr \\
|
|
1661
|
-
--message "$COMMIT_MSG"
|
|
1662
|
-
done
|
|
1663
|
-
env:
|
|
1664
|
-
GITHUB_TOKEN: \${{ secrets.SYNC_TOKEN }}
|
|
1665
|
-
GH_TOKEN: \${{ secrets.SYNC_TOKEN }}
|
|
1666
|
-
SECONDARY_REPOS: \${{ inputs.secondary-repos }}
|
|
1667
|
-
SYNC_BRANCH: \${{ inputs.sync-branch }}
|
|
1668
|
-
`,
|
|
1669
|
-
typecheck: `\
|
|
1670
|
-
name: Typecheck
|
|
1671
|
-
|
|
1672
|
-
on: # yamllint disable-line rule:truthy
|
|
1673
|
-
workflow_call:
|
|
1674
|
-
|
|
1675
|
-
jobs:
|
|
1676
|
-
typecheck:
|
|
1677
|
-
name: tsc --noEmit
|
|
1678
|
-
permissions:
|
|
1679
|
-
contents: read
|
|
1680
|
-
runs-on: ubuntu-latest
|
|
1681
|
-
timeout-minutes: 10
|
|
1682
|
-
steps:
|
|
1683
|
-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
1684
|
-
name: Checkout repository
|
|
1685
|
-
|
|
1686
|
-
- uses: theholocron/.github/.github/actions/setup@main
|
|
1687
|
-
name: Setup
|
|
1688
|
-
|
|
1689
|
-
- run: pnpm typecheck
|
|
1690
|
-
name: Type check
|
|
1691
|
-
`
|
|
899
|
+
audit: audit_default$1,
|
|
900
|
+
bookkeeping: bookkeeping_default$1,
|
|
901
|
+
codeql: codeql_default$1,
|
|
902
|
+
dependencies: dependencies_default$1,
|
|
903
|
+
greetings: greetings_default$1,
|
|
904
|
+
lint: lint_default$1,
|
|
905
|
+
release: release_default$1,
|
|
906
|
+
review: review_default$1,
|
|
907
|
+
stale: stale_default$1,
|
|
908
|
+
"sync-github": sync_github_default$1,
|
|
909
|
+
test: test_default$1,
|
|
910
|
+
typecheck: typecheck_default$1
|
|
1692
911
|
};
|
|
1693
|
-
const WORKFLOW_TEMPLATE_PROPERTIES = {
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
912
|
+
const WORKFLOW_TEMPLATE_PROPERTIES = {
|
|
913
|
+
bookkeeping: JSON.stringify({
|
|
914
|
+
name: "Bookkeeping",
|
|
915
|
+
description: "Label and track issues and pull requests.",
|
|
916
|
+
iconName: "octicon tag"
|
|
917
|
+
}, null, 2),
|
|
918
|
+
"sync-github": JSON.stringify({
|
|
919
|
+
name: "Sync GitHub Templates",
|
|
920
|
+
description: "Sync workflow templates and composite actions from the holocron CLI.",
|
|
921
|
+
iconName: "octicon sync"
|
|
922
|
+
}, null, 2)
|
|
923
|
+
};
|
|
924
|
+
//#endregion
|
|
925
|
+
//#region src/commands/dependabot.yml
|
|
926
|
+
var dependabot_default = "# AUTO-GENERATED by holocron — run `holocron setup` to regenerate.\nversion: 2\nupdates:\n - package-ecosystem: npm\n directory: /\n schedule:\n interval: weekly\n groups:\n security-patches:\n applies-to: security-updates\n patterns:\n - \"*\"\n all-dependencies:\n update-types:\n - minor\n - patch\n\n - package-ecosystem: github-actions\n directory: /\n schedule:\n interval: weekly\n groups:\n all-actions:\n patterns:\n - \"*\"\n";
|
|
927
|
+
//#endregion
|
|
928
|
+
//#region src/commands/workflows/audit.yml
|
|
929
|
+
var audit_default = "name: Audit\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n audit:\n uses: theholocron/.github/.github/workflows/audit.yml@main\n secrets: inherit\n";
|
|
930
|
+
//#endregion
|
|
931
|
+
//#region src/commands/workflows/bookkeeping.yml
|
|
932
|
+
var bookkeeping_default = "name: Bookkeeping\n\non: # yamllint disable-line rule:truthy\n pull_request:\n types:\n - opened\n - edited\n\npermissions:\n contents: read\n pull-requests: write\n\njobs:\n bookkeeping:\n uses: theholocron/.github/.github/workflows/bookkeeping.yml@main\n secrets: inherit\n";
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region src/commands/workflows/codeql.yml
|
|
935
|
+
var codeql_default = "name: CodeQL\n\non: # yamllint disable-line rule:truthy\n push:\n branches:\n - main\n pull_request:\n branches:\n - main\n schedule:\n - cron: \"0 0 * * 1\"\n\npermissions:\n actions: read\n contents: read\n security-events: write\n\njobs:\n codeql:\n uses: theholocron/.github/.github/workflows/codeql.yml@main\n secrets: inherit\n";
|
|
936
|
+
//#endregion
|
|
937
|
+
//#region src/commands/workflows/dependencies.yml
|
|
938
|
+
var dependencies_default = "name: Dependencies\n\non: # yamllint disable-line rule:truthy\n pull_request:\n\npermissions:\n contents: write\n pull-requests: write\n\njobs:\n dependencies:\n uses: theholocron/.github/.github/workflows/dependencies.yml@main\n secrets: inherit\n";
|
|
939
|
+
//#endregion
|
|
940
|
+
//#region src/commands/workflows/greetings.yml
|
|
941
|
+
var greetings_default = "name: Greetings\n\non: # yamllint disable-line rule:truthy\n pull_request:\n issues:\n\npermissions:\n issues: write\n pull-requests: write\n\njobs:\n greetings:\n uses: theholocron/.github/.github/workflows/greetings.yml@main\n secrets: inherit\n";
|
|
942
|
+
//#endregion
|
|
943
|
+
//#region src/commands/workflows/lint.yml
|
|
944
|
+
var lint_default = "name: Lint\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: lint-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: write\n statuses: write\n\njobs:\n lint:\n name: Lint\n uses: theholocron/.github/.github/workflows/lint.yml@main\n secrets: inherit\n with:\n enable-auto-commit: true\n";
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/commands/workflows/release.yml
|
|
947
|
+
var release_default = "name: Release\n\non: # yamllint disable-line rule:truthy\n push:\n branches:\n - main\n - alpha\n workflow_dispatch:\n\npermissions:\n contents: write\n id-token: write\n issues: write\n pull-requests: write\n\nconcurrency:\n group: ${{ github.workflow }}-${{ github.ref }}\n cancel-in-progress: false\n\njobs:\n release:\n uses: theholocron/.github/.github/workflows/release.yml@main\n secrets: inherit\n";
|
|
948
|
+
//#endregion
|
|
949
|
+
//#region src/commands/workflows/review.yml
|
|
950
|
+
var review_default = "name: Review\n\non: # yamllint disable-line rule:truthy\n pull_request:\n\nconcurrency:\n group: review-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n checks: write\n pull-requests: write\n\njobs:\n review:\n name: Review\n uses: theholocron/.github/.github/workflows/review.yml@main\n secrets: inherit\n";
|
|
951
|
+
//#endregion
|
|
952
|
+
//#region src/commands/workflows/stale.yml
|
|
953
|
+
var stale_default = "name: Stale\n\non: # yamllint disable-line rule:truthy\n schedule:\n - cron: \"30 1 * * *\"\n\npermissions:\n contents: write\n issues: write\n pull-requests: write\n\njobs:\n stale:\n uses: theholocron/.github/.github/workflows/stale.yml@main\n secrets: inherit\n";
|
|
954
|
+
//#endregion
|
|
955
|
+
//#region src/commands/workflows/sync-github.yml
|
|
956
|
+
var sync_github_default = "name: Sync GitHub Templates\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n paths:\n - packages/cli/src/templates/index.ts\n - packages/cli/src/commands/setup-workflows.ts\n\nconcurrency:\n group: sync-github-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n sync:\n name: Sync\n uses: theholocron/.github/.github/workflows/sync-github.yml@main\n with:\n secondary-repos: theholocron/.github-private\n secrets:\n SYNC_TOKEN: ${{ secrets.SYNC_TOKEN }}\n";
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region src/commands/workflows/test.yml
|
|
959
|
+
var test_default = "name: Test\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: test-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n test:\n name: Test\n uses: theholocron/.github/.github/workflows/test.yml@main\n secrets: inherit\n";
|
|
960
|
+
//#endregion
|
|
961
|
+
//#region src/commands/workflows/typecheck.yml
|
|
962
|
+
var typecheck_default = "name: Typecheck\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: typecheck-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n typecheck:\n name: Typecheck\n uses: theholocron/.github/.github/workflows/typecheck.yml@main\n secrets: inherit\n";
|
|
1698
963
|
//#endregion
|
|
1699
964
|
//#region src/commands/setup-workflows.ts
|
|
1700
|
-
/**
|
|
1701
|
-
* Thin workflow wrapper templates for `holocron setup`.
|
|
1702
|
-
*
|
|
1703
|
-
* Each entry is a complete `.github/workflows/<name>.yml` that delegates
|
|
1704
|
-
* to the corresponding reusable `ci-<name>.yml` in `theholocron/.github`.
|
|
1705
|
-
* Files are overwritten on each setup run — they are generated artifacts.
|
|
1706
|
-
*/
|
|
1707
|
-
const WORKFLOW_REPO = "theholocron/.github";
|
|
1708
|
-
const WORKFLOW_REF = "main";
|
|
1709
|
-
function ref(name) {
|
|
1710
|
-
return `${WORKFLOW_REPO}/.github/workflows/${name}.yml@${WORKFLOW_REF}`;
|
|
1711
|
-
}
|
|
1712
965
|
/** Header prepended when holocron setup writes a thin caller to a repo. */
|
|
1713
966
|
function workflowHeader() {
|
|
1714
967
|
return [
|
|
@@ -1721,254 +974,18 @@ function workflowHeader() {
|
|
|
1721
974
|
].join("\n");
|
|
1722
975
|
}
|
|
1723
976
|
const WORKFLOW_TEMPLATES = {
|
|
1724
|
-
lint:
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
permissions:
|
|
1737
|
-
contents: write
|
|
1738
|
-
statuses: write
|
|
1739
|
-
|
|
1740
|
-
jobs:
|
|
1741
|
-
lint:
|
|
1742
|
-
name: Lint
|
|
1743
|
-
uses: ${ref("lint")}
|
|
1744
|
-
secrets: inherit
|
|
1745
|
-
with:
|
|
1746
|
-
enable-auto-commit: true
|
|
1747
|
-
`,
|
|
1748
|
-
test: `\
|
|
1749
|
-
name: Test
|
|
1750
|
-
|
|
1751
|
-
on: # yamllint disable-line rule:truthy
|
|
1752
|
-
push:
|
|
1753
|
-
branches: [main, alpha]
|
|
1754
|
-
pull_request:
|
|
1755
|
-
|
|
1756
|
-
concurrency:
|
|
1757
|
-
group: test-\${{ github.ref }}
|
|
1758
|
-
cancel-in-progress: true
|
|
1759
|
-
|
|
1760
|
-
permissions:
|
|
1761
|
-
contents: read
|
|
1762
|
-
|
|
1763
|
-
jobs:
|
|
1764
|
-
test:
|
|
1765
|
-
name: Test
|
|
1766
|
-
uses: ${ref("test")}
|
|
1767
|
-
secrets: inherit
|
|
1768
|
-
`,
|
|
1769
|
-
typecheck: `\
|
|
1770
|
-
name: Typecheck
|
|
1771
|
-
|
|
1772
|
-
on: # yamllint disable-line rule:truthy
|
|
1773
|
-
push:
|
|
1774
|
-
branches: [main, alpha]
|
|
1775
|
-
pull_request:
|
|
1776
|
-
|
|
1777
|
-
concurrency:
|
|
1778
|
-
group: typecheck-\${{ github.ref }}
|
|
1779
|
-
cancel-in-progress: true
|
|
1780
|
-
|
|
1781
|
-
permissions:
|
|
1782
|
-
contents: read
|
|
1783
|
-
|
|
1784
|
-
jobs:
|
|
1785
|
-
typecheck:
|
|
1786
|
-
name: Typecheck
|
|
1787
|
-
uses: ${ref("typecheck")}
|
|
1788
|
-
secrets: inherit
|
|
1789
|
-
`,
|
|
1790
|
-
codeql: `\
|
|
1791
|
-
name: CodeQL
|
|
1792
|
-
|
|
1793
|
-
on: # yamllint disable-line rule:truthy
|
|
1794
|
-
push:
|
|
1795
|
-
branches:
|
|
1796
|
-
- main
|
|
1797
|
-
pull_request:
|
|
1798
|
-
branches:
|
|
1799
|
-
- main
|
|
1800
|
-
schedule:
|
|
1801
|
-
- cron: "0 0 * * 1"
|
|
1802
|
-
|
|
1803
|
-
permissions:
|
|
1804
|
-
actions: read
|
|
1805
|
-
contents: read
|
|
1806
|
-
security-events: write
|
|
1807
|
-
|
|
1808
|
-
jobs:
|
|
1809
|
-
codeql:
|
|
1810
|
-
uses: ${ref("codeql")}
|
|
1811
|
-
secrets: inherit
|
|
1812
|
-
`,
|
|
1813
|
-
review: `\
|
|
1814
|
-
name: Review
|
|
1815
|
-
|
|
1816
|
-
on: # yamllint disable-line rule:truthy
|
|
1817
|
-
pull_request:
|
|
1818
|
-
|
|
1819
|
-
concurrency:
|
|
1820
|
-
group: review-\${{ github.ref }}
|
|
1821
|
-
cancel-in-progress: true
|
|
1822
|
-
|
|
1823
|
-
permissions:
|
|
1824
|
-
contents: read
|
|
1825
|
-
checks: write
|
|
1826
|
-
pull-requests: write
|
|
1827
|
-
|
|
1828
|
-
jobs:
|
|
1829
|
-
review:
|
|
1830
|
-
name: Review
|
|
1831
|
-
uses: ${ref("review")}
|
|
1832
|
-
secrets: inherit
|
|
1833
|
-
`,
|
|
1834
|
-
release: `\
|
|
1835
|
-
name: Release
|
|
1836
|
-
|
|
1837
|
-
on: # yamllint disable-line rule:truthy
|
|
1838
|
-
push:
|
|
1839
|
-
branches:
|
|
1840
|
-
- main
|
|
1841
|
-
- alpha
|
|
1842
|
-
workflow_dispatch:
|
|
1843
|
-
|
|
1844
|
-
permissions:
|
|
1845
|
-
contents: write
|
|
1846
|
-
id-token: write
|
|
1847
|
-
issues: write
|
|
1848
|
-
pull-requests: write
|
|
1849
|
-
|
|
1850
|
-
concurrency:
|
|
1851
|
-
group: \${{ github.workflow }}-\${{ github.ref }}
|
|
1852
|
-
cancel-in-progress: false
|
|
1853
|
-
|
|
1854
|
-
jobs:
|
|
1855
|
-
release:
|
|
1856
|
-
uses: ${ref("release")}
|
|
1857
|
-
secrets: inherit
|
|
1858
|
-
`,
|
|
1859
|
-
stale: `\
|
|
1860
|
-
name: Stale
|
|
1861
|
-
|
|
1862
|
-
on: # yamllint disable-line rule:truthy
|
|
1863
|
-
schedule:
|
|
1864
|
-
- cron: "30 1 * * *"
|
|
1865
|
-
|
|
1866
|
-
permissions:
|
|
1867
|
-
contents: write
|
|
1868
|
-
issues: write
|
|
1869
|
-
pull-requests: write
|
|
1870
|
-
|
|
1871
|
-
jobs:
|
|
1872
|
-
stale:
|
|
1873
|
-
uses: ${ref("stale")}
|
|
1874
|
-
secrets: inherit
|
|
1875
|
-
`,
|
|
1876
|
-
greetings: `\
|
|
1877
|
-
name: Greetings
|
|
1878
|
-
|
|
1879
|
-
on: # yamllint disable-line rule:truthy
|
|
1880
|
-
pull_request:
|
|
1881
|
-
issues:
|
|
1882
|
-
|
|
1883
|
-
permissions:
|
|
1884
|
-
issues: write
|
|
1885
|
-
pull-requests: write
|
|
1886
|
-
|
|
1887
|
-
jobs:
|
|
1888
|
-
greetings:
|
|
1889
|
-
uses: ${ref("greetings")}
|
|
1890
|
-
secrets: inherit
|
|
1891
|
-
`,
|
|
1892
|
-
dependencies: `\
|
|
1893
|
-
name: Dependencies
|
|
1894
|
-
|
|
1895
|
-
on: # yamllint disable-line rule:truthy
|
|
1896
|
-
pull_request:
|
|
1897
|
-
|
|
1898
|
-
permissions:
|
|
1899
|
-
contents: write
|
|
1900
|
-
pull-requests: write
|
|
1901
|
-
|
|
1902
|
-
jobs:
|
|
1903
|
-
dependencies:
|
|
1904
|
-
uses: ${ref("dependencies")}
|
|
1905
|
-
secrets: inherit
|
|
1906
|
-
`,
|
|
1907
|
-
bookkeeping: `\
|
|
1908
|
-
name: Bookkeeping
|
|
1909
|
-
|
|
1910
|
-
on: # yamllint disable-line rule:truthy
|
|
1911
|
-
pull_request:
|
|
1912
|
-
types:
|
|
1913
|
-
- opened
|
|
1914
|
-
- edited
|
|
1915
|
-
issues:
|
|
1916
|
-
types:
|
|
1917
|
-
- opened
|
|
1918
|
-
- edited
|
|
1919
|
-
|
|
1920
|
-
permissions:
|
|
1921
|
-
contents: read
|
|
1922
|
-
issues: write
|
|
1923
|
-
pull-requests: write
|
|
1924
|
-
|
|
1925
|
-
jobs:
|
|
1926
|
-
bookkeeping:
|
|
1927
|
-
uses: ${ref("bookkeeping")}
|
|
1928
|
-
secrets: inherit
|
|
1929
|
-
`,
|
|
1930
|
-
audit: `\
|
|
1931
|
-
name: Audit
|
|
1932
|
-
|
|
1933
|
-
on: # yamllint disable-line rule:truthy
|
|
1934
|
-
push:
|
|
1935
|
-
branches: [main, alpha]
|
|
1936
|
-
pull_request:
|
|
1937
|
-
|
|
1938
|
-
permissions:
|
|
1939
|
-
contents: read
|
|
1940
|
-
|
|
1941
|
-
jobs:
|
|
1942
|
-
audit:
|
|
1943
|
-
uses: ${ref("audit")}
|
|
1944
|
-
secrets: inherit
|
|
1945
|
-
`,
|
|
1946
|
-
"sync-github": `\
|
|
1947
|
-
name: Sync GitHub Templates
|
|
1948
|
-
|
|
1949
|
-
on: # yamllint disable-line rule:truthy
|
|
1950
|
-
push:
|
|
1951
|
-
branches: [main, alpha]
|
|
1952
|
-
paths:
|
|
1953
|
-
- packages/cli/src/templates/index.ts
|
|
1954
|
-
- packages/cli/src/commands/setup-workflows.ts
|
|
1955
|
-
|
|
1956
|
-
concurrency:
|
|
1957
|
-
group: sync-github-\${{ github.ref }}
|
|
1958
|
-
cancel-in-progress: true
|
|
1959
|
-
|
|
1960
|
-
permissions:
|
|
1961
|
-
contents: read
|
|
1962
|
-
|
|
1963
|
-
jobs:
|
|
1964
|
-
sync:
|
|
1965
|
-
name: Sync
|
|
1966
|
-
uses: ${ref("sync-github")}
|
|
1967
|
-
with:
|
|
1968
|
-
secondary-repos: theholocron/.github-private
|
|
1969
|
-
secrets:
|
|
1970
|
-
SYNC_TOKEN: \${{ secrets.SYNC_TOKEN }}
|
|
1971
|
-
`
|
|
977
|
+
lint: lint_default,
|
|
978
|
+
test: test_default,
|
|
979
|
+
typecheck: typecheck_default,
|
|
980
|
+
codeql: codeql_default,
|
|
981
|
+
review: review_default,
|
|
982
|
+
release: release_default,
|
|
983
|
+
stale: stale_default,
|
|
984
|
+
greetings: greetings_default,
|
|
985
|
+
dependencies: dependencies_default,
|
|
986
|
+
bookkeeping: bookkeeping_default,
|
|
987
|
+
audit: audit_default,
|
|
988
|
+
"sync-github": sync_github_default
|
|
1972
989
|
};
|
|
1973
990
|
const KNOWN_WORKFLOWS = new Set(Object.keys(WORKFLOW_TEMPLATES));
|
|
1974
991
|
/**
|
|
@@ -3977,33 +2994,6 @@ function labelerConfig() {
|
|
|
3977
2994
|
``
|
|
3978
2995
|
].join("\n");
|
|
3979
2996
|
}
|
|
3980
|
-
const DEPENDABOT_CONFIG = `\
|
|
3981
|
-
# AUTO-GENERATED by holocron — run \`holocron setup\` to regenerate.
|
|
3982
|
-
version: 2
|
|
3983
|
-
updates:
|
|
3984
|
-
- package-ecosystem: npm
|
|
3985
|
-
directory: /
|
|
3986
|
-
schedule:
|
|
3987
|
-
interval: weekly
|
|
3988
|
-
groups:
|
|
3989
|
-
security-patches:
|
|
3990
|
-
applies-to: security-updates
|
|
3991
|
-
patterns:
|
|
3992
|
-
- "*"
|
|
3993
|
-
all-dependencies:
|
|
3994
|
-
update-types:
|
|
3995
|
-
- minor
|
|
3996
|
-
- patch
|
|
3997
|
-
|
|
3998
|
-
- package-ecosystem: github-actions
|
|
3999
|
-
directory: /
|
|
4000
|
-
schedule:
|
|
4001
|
-
interval: weekly
|
|
4002
|
-
groups:
|
|
4003
|
-
all-actions:
|
|
4004
|
-
patterns:
|
|
4005
|
-
- "*"
|
|
4006
|
-
`;
|
|
4007
2997
|
const RULESET_NAME = "holocron-default-branch";
|
|
4008
2998
|
const BALANCED_REPO_SETTINGS = {
|
|
4009
2999
|
allow_squash_merge: true,
|
|
@@ -4213,7 +3203,7 @@ async function runSetup(input) {
|
|
|
4213
3203
|
if (loader.has("source") && effectivePreset !== "none") {
|
|
4214
3204
|
const source = loader.get("source");
|
|
4215
3205
|
steps.push(await runStep("source", "write .github/dependabot.yml", dryRun, async () => {
|
|
4216
|
-
await source.writeRepoFile(".github/dependabot.yml",
|
|
3206
|
+
await source.writeRepoFile(".github/dependabot.yml", dependabot_default);
|
|
4217
3207
|
}));
|
|
4218
3208
|
print(formatStep(steps[steps.length - 1]));
|
|
4219
3209
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/cli",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.66",
|
|
4
4
|
"description": "The Holocron CLI — a pluggable, capability-based orchestrator for spinning up and operating software projects.",
|
|
5
5
|
"homepage": "https://github.com/theholocron/holocron/tree/main/packages/cli#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/holocron/issues",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
|
-
"build": "tsdown",
|
|
62
|
+
"build": "tsdown --config-loader tsx",
|
|
63
63
|
"start": "tsx ./src/cli.ts",
|
|
64
64
|
"lint": "eslint .",
|
|
65
65
|
"typecheck": "tsc --noEmit",
|