fix: test failures caused by GitHub Actions token masking, updates (#97)

* Initial plan

* Fix test token masking issue in GitHub Actions

Co-authored-by: ivuorinen <11024+ivuorinen@users.noreply.github.com>

* chore: update permissions, go version, linting

* fix(ci): ignore test tokens for gitleaks

* chore: add fetch-depth zero to all checkout actions

* fix(ci): pr-lint contents write permission

* [MegaLinter] Apply linters fixes

* chore: ignore and remove megalinter-reports

* fix: restore commitlint pre-commit hook to v9.24.0

Co-authored-by: ivuorinen <11024+ivuorinen@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ivuorinen <11024+ivuorinen@users.noreply.github.com>
Co-authored-by: Ismo Vuorinen <ismo@ivuorinen.net>
This commit is contained in:
Copilot
2025-11-13 18:13:20 +02:00
committed by GitHub
parent f4222fb6f3
commit d09c7918cb
23 changed files with 89 additions and 72 deletions

View File

@@ -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"]
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

3
.gitignore vendored
View File

@@ -34,3 +34,6 @@ testdata/**/*.md
testdata/**/*.html
testdata/**/*.json
coverage.*
# Other
/megalinter-reports/

View File

@@ -1,5 +1,8 @@
# Gitleaks ignore patterns
# https://github.com/gitleaks/gitleaks
#
# Format: <commit-hash>:<file-path>:<rule-name>:<line-number>
# Or without commit hash for dir scans: <file-path>:<rule-name>:<line-number>
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

View File

@@ -1 +1 @@
1.24.6
1.25.4

View File

@@ -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]

View File

@@ -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` |

View File

@@ -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 |

View File

@@ -4,7 +4,7 @@ This project follows [Conventional Commits](https://www.conventionalcommits.org/
## Format
```
```text
<type>(<scope>): <subject>
<body>
@@ -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

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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:
<details>
<summary>📋 Inputs</summary>
| 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` |
</details>
```

View File

@@ -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 |

10
go.mod
View File

@@ -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
)

22
go.sum
View File

@@ -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=

View File

@@ -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)

View File

@@ -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)
},
},
{

View File

@@ -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)
},
},
{

View File

@@ -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