(b *testing.B)
| 321 | } |
| 322 | |
| 323 | func BenchmarkWriteJavaScriptToYAML(b *testing.B) { |
| 324 | script := `const github = require('@actions/github'); |
| 325 | const core = require('@actions/core'); |
| 326 | |
| 327 | const token = process.env.GITHUB_TOKEN; |
| 328 | const context = github.context; |
| 329 | |
| 330 | if (!token) { |
| 331 | core.setFailed('GITHUB_TOKEN is required'); |
| 332 | return; |
| 333 | } |
| 334 | |
| 335 | const octokit = github.getOctokit(token); |
| 336 | |
| 337 | // Create a pull request |
| 338 | const result = await octokit.rest.pulls.create({ |
| 339 | owner: context.repo.owner, |
| 340 | repo: context.repo.repo, |
| 341 | title: 'Automated PR', |
| 342 | head: 'feature-branch', |
| 343 | base: 'main', |
| 344 | body: 'This is an automated pull request' |
| 345 | }); |
| 346 | |
| 347 | console.log('PR created:', result.data.html_url);` |
| 348 | |
| 349 | for b.Loop() { |
| 350 | var yaml strings.Builder |
| 351 | WriteJavaScriptToYAML(&yaml, script) |
| 352 | } |
| 353 | } |
nothing calls this directly
no test coverage detected