diff --git a/.commitlintrc.json b/.commitlintrc.json index bd1278f..66ca2e5 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -1,28 +1,12 @@ { "extends": ["@commitlint/config-conventional"], "rules": { - "type-enum": [ - 2, - "always", - [ - "feat", - "fix", - "docs", - "style", - "refactor", - "perf", - "test", - "chore", - "ci", - "build", - "revert" - ] - ], + "type-enum": [2, "always", ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "ci", "build", "revert"]], "type-case": [2, "always", "lower-case"], "type-empty": [2, "never"], "subject-empty": [2, "never"], "subject-full-stop": [2, "never", "."], - "header-max-length": [2, "always", 72], + "header-max-length": [2, "always", 100], "body-leading-blank": [1, "always"], "footer-leading-blank": [1, "always"] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 695dc4f..de059ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 - name: Install dependencies diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8259f50..69ea422 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -30,6 +30,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 0 - name: Initialize CodeQL uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2 diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index a74c128..b356b00 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -20,9 +20,12 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 permissions: - statuses: write - contents: read + actions: write + contents: write + issues: write packages: read + pull-requests: write + statuses: write steps: - name: Run PR Lint diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 8c91ec8..6ccb449 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -30,6 +30,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 @@ -49,6 +51,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + fetch-depth: 0 - name: Run Trivy vulnerability scanner in repo mode uses: aquasecurity/trivy-action@master # 0.32.0 @@ -96,6 +100,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 @@ -130,6 +136,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + fetch-depth: 0 - name: Dependency Review uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index eb26969..f420362 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -36,6 +36,7 @@ jobs: - name: โคต๏ธ Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: + fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - name: โคต๏ธ Sync Latest Labels Definitions uses: ivuorinen/actions/sync-labels@ff0ca4bc920c518b2ce2dc20c5e5a6e95f76dee0 # v2025.11.02 diff --git a/.gitignore b/.gitignore index dab3f25..5c8f280 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ testdata/**/*.md testdata/**/*.html testdata/**/*.json coverage.* + +# Other +/megalinter-reports/ diff --git a/.gitleaksignore b/.gitleaksignore index 6d75edc..ee8eb5a 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -1,5 +1,8 @@ # Gitleaks ignore patterns # https://github.com/gitleaks/gitleaks +# +# Format: ::: +# Or without commit hash for dir scans: :: f9823eef3ec602b92ab4f17b3b4b93b2f219fb6a:internal/wizard/validator_test.go:generic-api-key:195 f9823eef3ec602b92ab4f17b3b4b93b2f219fb6a:internal/wizard/validator_test.go:generic-api-key:197 @@ -7,3 +10,16 @@ f9823eef3ec602b92ab4f17b3b4b93b2f219fb6a:internal/wizard/validator_test.go:gener f9823eef3ec602b92ab4f17b3b4b93b2f219fb6a:internal/wizard/validator_test.go:generic-api-key:199 f9823eef3ec602b92ab4f17b3b4b93b2f219fb6a:internal/wizard/validator_test.go:generic-api-key:200 f9823eef3ec602b92ab4f17b3b4b93b2f219fb6a:internal/wizard/validator_test.go:github-pat:195 + +# Test tokens (using fingerprint format for dir scans) +internal/configuration_loader_test.go:github-pat:141 +internal/configuration_loader_test.go:github-pat:173 +internal/wizard/validator_test.go:generic-api-key:204 +internal/wizard/validator_test.go:generic-api-key:206 +internal/wizard/validator_test.go:generic-api-key:207 +internal/wizard/validator_test.go:generic-api-key:208 +internal/wizard/validator_test.go:generic-api-key:209 +internal/wizard/validator_test.go:github-pat:204 +integration_test.go:github-pat:304 +internal/config_test.go:github-pat:133 +internal/config_test.go:github-pat:162 diff --git a/.go-version b/.go-version index 7a429d6..26a9e99 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.24.6 +1.25.4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d6fa82..a316a58 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: # Renovatebot pre-commit hooks - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 42.1.3 + rev: 42.7.0 hooks: - id: renovate-config-validator @@ -40,9 +40,10 @@ repos: # Markdown linting with markdownlint-cli2 (excluding legacy files) - repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.18.1 + rev: v0.19.0 hooks: - id: markdownlint-cli2 + args: [--fix] exclude: "^testdata/" # EditorConfig checking @@ -54,7 +55,7 @@ repos: # Go formatting, imports, and linting - repo: https://github.com/TekWizely/pre-commit-golang - rev: v1.0.0-rc.2 + rev: v1.0.0-rc.4 hooks: - id: go-imports-repo args: [-w] diff --git a/CLAUDE.md b/CLAUDE.md index cd7ba0d..ca4efc5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -84,7 +84,7 @@ cd testdata/example-action/ ## ๐Ÿ“Š Feature Matrix | Feature | Status | Files | -|---------|--------|-------| +| --------- | -------- | ------- | | CLI Framework | โœ… | `main.go` | | Enhanced Gen Command | โœ… | `main.go:168-180` | | File Discovery | โœ… | `generator.go:304-324` | diff --git a/README.md b/README.md index e40dddd..a082a3f 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ Contributions welcome! Fork, create feature branch, add tests, submit PR. ## ๐Ÿ“Š Comparison | Feature | gh-action-readme | action-docs | gh-actions-auto-docs | -|---------|------------------|-------------|----------------------| +| --------- | ------------------ | ------------- | ---------------------- | | **Themes** | 5 themes | 1 basic | 1 basic | | **Output Formats** | 4 formats | 1 format | 1 format | | **Validation** | Smart suggestions | Basic | None | diff --git a/docs/COMMIT_MESSAGES.md b/docs/COMMIT_MESSAGES.md index 5b9f00f..182d716 100644 --- a/docs/COMMIT_MESSAGES.md +++ b/docs/COMMIT_MESSAGES.md @@ -4,7 +4,7 @@ This project follows [Conventional Commits](https://www.conventionalcommits.org/ ## Format -``` +```text (): @@ -42,7 +42,7 @@ The subject contains a succinct description of the change: ### Examples -``` +```text feat: add support for AsciiDoc output format fix: correct template rendering for empty descriptions docs: update installation instructions diff --git a/docs/api.md b/docs/api.md index ebdb82d..c6e3acd 100644 --- a/docs/api.md +++ b/docs/api.md @@ -36,21 +36,21 @@ gh-action-readme gen [directory_or_file] [flags] #### Output Options | Flag | Short | Type | Default | Description | -|------|-------|------|---------|-------------| +| ------ | ------- | ------ | --------- | ------------- | | `--output-format` | `-f` | string | `md` | Output format: md, html, json, asciidoc | | `--output-dir` | `-o` | string | `.` | Output directory for generated files | | `--output` | | string | | Custom output filename (overrides default naming) | #### Theme Options -| Flag | Short | Type | Default | Description | -|------|-------|------|---------|-------------| -| `--theme` | `-t` | string | `default` | Theme: github, gitlab, minimal, professional, default | +| Flag | Short | Type | Default | Description | +| --------- | ----- | ------ | --------- | -------------------------------------------------------- | +| `--theme` | `-t` | string | `default` | Theme: github, gitlab, minimal, professional, default | #### Processing Options | Flag | Short | Type | Default | Description | -|------|-------|------|---------|-------------| +| ------ | ------- | ------ | --------- | ------------- | | `--recursive` | `-r` | boolean | `false` | Search directories recursively for action.yml files | | `--quiet` | `-q` | boolean | `false` | Suppress progress output | | `--verbose` | `-v` | boolean | `false` | Enable verbose logging | @@ -58,7 +58,7 @@ gh-action-readme gen [directory_or_file] [flags] #### GitHub Integration | Flag | Short | Type | Default | Description | -|------|-------|------|---------|-------------| +| ------ | ------- | ------ | --------- | ------------- | | `--github-token` | | string | | GitHub personal access token (or use GITHUB_TOKEN env) | | `--no-dependencies` | | boolean | `false` | Disable dependency analysis | @@ -152,7 +152,7 @@ gh-action-readme validate [file_or_directory] [flags] ### Flags | Flag | Short | Type | Default | Description | -|------|-------|------|---------|-------------| +| ------ | ------- | ------ | --------- | ------------- | | `--verbose` | `-v` | boolean | `false` | Show detailed validation messages | | `--quiet` | `-q` | boolean | `false` | Only show errors, suppress warnings | | `--recursive` | `-r` | boolean | `false` | Validate recursively | @@ -343,7 +343,7 @@ gh-action-readme help config wizard These flags are available for all commands: | Flag | Short | Type | Default | Description | -|------|-------|------|---------|-------------| +| ------ | ------- | ------ | --------- | ------------- | | `--config` | | string | | Custom configuration file path | | `--help` | `-h` | boolean | `false` | Show help for command | | `--quiet` | `-q` | boolean | `false` | Suppress non-error output | @@ -352,7 +352,7 @@ These flags are available for all commands: ## ๐Ÿ“Š Exit Codes | Code | Description | -|------|-------------| +| ------ | ------------- | | `0` | Success | | `1` | General error | | `2` | Invalid arguments | diff --git a/docs/configuration.md b/docs/configuration.md index 0b24064..86fe234 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -33,7 +33,7 @@ cache_ttl: 3600 ### Core Settings | Option | Type | Default | Description | -|--------|------|---------|-------------| +| -------- | ------ | --------- | ------------- | | `theme` | string | `default` | Default theme to use | | `output_format` | string | `md` | Default output format | | `output_dir` | string | `.` | Default output directory | @@ -42,7 +42,7 @@ cache_ttl: 3600 ### GitHub Integration | Option | Type | Default | Description | -|--------|------|---------|-------------| +| -------- | ------ | --------- | ------------- | | `github_token` | string | `""` | GitHub personal access token | | `dependencies_enabled` | boolean | `true` | Enable dependency analysis | | `rate_limit_delay` | int | `1000` | Delay between API calls (ms) | @@ -50,7 +50,7 @@ cache_ttl: 3600 ### Performance Settings | Option | Type | Default | Description | -|--------|------|---------|-------------| +| -------- | ------ | --------- | ------------- | | `cache_ttl` | int | `3600` | Cache TTL in seconds | | `concurrent_requests` | int | `3` | Max concurrent GitHub API requests | | `timeout` | int | `30` | Request timeout in seconds | diff --git a/docs/themes.md b/docs/themes.md index 0472e12..8d18626 100644 --- a/docs/themes.md +++ b/docs/themes.md @@ -92,7 +92,7 @@ gh-action-readme gen --theme default ## ๐ŸŽฏ Theme Comparison | Feature | GitHub | GitLab | Minimal | Professional | Default | -|---------|--------|--------|---------|-------------|---------| +| --------- | -------- | -------- | --------- | ------------- | --------- | | **Badges** | โœ… Rich | โœ… GitLab | โŒ None | โœ… Comprehensive | โŒ None | | **TOC** | โœ… Yes | โœ… Yes | โŒ No | โœ… Advanced | โŒ No | | **Examples** | โœ… GitHub | โœ… CI/CD | โœ… Basic | โœ… Comprehensive | โœ… Basic | @@ -146,10 +146,10 @@ runs:
๐Ÿ“‹ Inputs -| Input | Description | Required | Default | -|-------|-------------|----------|---------| -| `aws-region` | AWS region to deploy to | Yes | `us-east-1` | -| `environment` | Deployment environment | No | `production` | +| Input | Description | Required | Default | +| ------------- | ------------------------ | -------- | ------------- | +| `aws-region` | AWS region to deploy to | Yes | `us-east-1` | +| `environment` | Deployment environment | No | `production` |
``` diff --git a/docs/usage.md b/docs/usage.md index 39c4a70..f9599de 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -147,7 +147,7 @@ gh-action-readme gen --output-format json --output api/action.json ## ๐Ÿ“„ Output Formats | Format | Description | Use Case | Extension | -|--------|-------------|----------|-----------| +| -------- | ------------- | ---------- | ----------- | | **md** | Markdown (default) | GitHub README files | `.md` | | **html** | Styled HTML | Web documentation | `.html` | | **json** | Structured data | API integration | `.json` | @@ -174,7 +174,7 @@ gh-action-readme gen --output-format asciidoc --output docs/action.adoc See [themes.md](themes.md) for detailed theme documentation. | Theme | Best For | Features | -|-------|----------|----------| +| ------- | ---------- | ---------- | | **github** | GitHub marketplace | Badges, collapsible sections | | **gitlab** | GitLab repositories | CI/CD examples | | **minimal** | Simple actions | Clean, concise | diff --git a/go.mod b/go.mod index 4d0cfd9..44d0e19 100644 --- a/go.mod +++ b/go.mod @@ -26,14 +26,14 @@ require ( github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/sagikazarmark/locafero v0.11.0 // indirect - github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect + github.com/sagikazarmark/locafero v0.12.0 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/subosito/gotenv v1.6.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/term v0.33.0 // indirect - golang.org/x/text v0.28.0 // indirect + golang.org/x/sys v0.38.0 // indirect + golang.org/x/term v0.37.0 // indirect + golang.org/x/text v0.31.0 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect ) diff --git a/go.sum b/go.sum index 43f8c6c..301264d 100644 --- a/go.sum +++ b/go.sum @@ -47,12 +47,10 @@ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= -github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= +github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4= +github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI= github.com/schollz/progressbar/v3 v3.18.0 h1:uXdoHABRFmNIjUfte/Ex7WtuyVslrw2wVPQmCN62HpA= github.com/schollz/progressbar/v3 v3.18.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec= -github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= -github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= @@ -70,19 +68,15 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo= -golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= -golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= -golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= -golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= +golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/integration_test.go b/integration_test.go index f22ec47..721ff75 100644 --- a/integration_test.go +++ b/integration_test.go @@ -301,7 +301,7 @@ func setupConfigurationHierarchyWorkflow(t *testing.T, tmpDir string) { globalConfig := `theme: default output_format: md verbose: false -github_token: global-token` +github_token: ghp_test1234567890abcdefghijklmnopqrstuvwxyz` testutil.WriteTestFile(t, filepath.Join(globalConfigDir, "config.yml"), globalConfig) // Repository configuration (medium priority) diff --git a/internal/config_test.go b/internal/config_test.go index c75150e..b127400 100644 --- a/internal/config_test.go +++ b/internal/config_test.go @@ -130,7 +130,7 @@ func TestLoadConfiguration(t *testing.T) { testutil.WriteTestFile(t, globalConfigPath, ` theme: default output_format: md -github_token: global-token +github_token: ghp_test1234567890abcdefghijklmnopqrstuvwxyz `) // Create repo root with repo-specific config @@ -159,7 +159,7 @@ output_dir: output // Should inherit from repo level testutil.AssertEqual(t, "html", config.OutputFormat) // Should inherit GitHub token from global config - testutil.AssertEqual(t, "global-token", config.GitHubToken) + testutil.AssertEqual(t, "ghp_test1234567890abcdefghijklmnopqrstuvwxyz", config.GitHubToken) }, }, { diff --git a/internal/configuration_loader_test.go b/internal/configuration_loader_test.go index f3a06b9..a0ff48e 100644 --- a/internal/configuration_loader_test.go +++ b/internal/configuration_loader_test.go @@ -138,7 +138,7 @@ func TestConfigurationLoader_LoadConfiguration(t *testing.T) { testutil.WriteTestFile(t, globalConfigPath, ` theme: default output_format: md -github_token: global-token +github_token: ghp_test1234567890abcdefghijklmnopqrstuvwxyz verbose: false `) @@ -170,7 +170,7 @@ quiet: false testutil.AssertEqual(t, "html", config.OutputFormat) testutil.AssertEqual(t, true, config.Verbose) // Should inherit GitHub token from global config - testutil.AssertEqual(t, "global-token", config.GitHubToken) + testutil.AssertEqual(t, "ghp_test1234567890abcdefghijklmnopqrstuvwxyz", config.GitHubToken) }, }, { diff --git a/internal/json_writer.go b/internal/json_writer.go index 20a596d..bfe4cbf 100644 --- a/internal/json_writer.go +++ b/internal/json_writer.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "os" + "strings" "time" ) @@ -244,6 +245,7 @@ func (jw *JSONWriter) generateBasicExample(action *ActionYML) string { if len(action.Inputs) > 0 { example += "\n with:" + var exampleSb247 strings.Builder for key, input := range action.Inputs { value := "value" if input.Default != nil { @@ -253,8 +255,9 @@ func (jw *JSONWriter) generateBasicExample(action *ActionYML) string { value = fmt.Sprintf("%v", input.Default) } } - example += "\n " + key + ": \"" + value + "\"" + exampleSb247.WriteString("\n " + key + ": \"" + value + "\"") } + example += exampleSb247.String() } return example