benchmark-action / benchmark-action/github-action-benchmark

gh-pages branch should be created manually beforehand

Open
#147 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.3k
Forks
184
PR merge metrics
No merged PRs in 30d

Description

This should be reflected either on the docs or automated in the code, otherwise a first run will fail, i.e:

![Screen Shot 2023-01-05 at 11 42 27 am](https://user-images.githubusercontent.com/175587/210676373-a05bba0a-51f0-491e-a68b-52515e4e81be.png)

Ideally I should be created based on `ghPagesBranch` config in `write.ts`, right before fetching for that branch specifically, otherwise it'll fail as shown above:

``` typescript
if (githubToken && !skipFetchGhPages && ghRepository) {
benchmarkBaseDir = './benchmark-data-repository';
await git.clone(githubToken, ghRepository, benchmarkBaseDir);
extraGitArguments = [`--work-tree=${benchmarkBaseDir}`, `--git-dir=${benchmarkBaseDir}/.git`];
// TODO: Create gh_pages branch if not already present? <----
await git.checkout(ghPagesBranch, extraGitArguments);
} else if (!skipFetchGhPages && (!isPrivateRepo || githubToken)) {
await git.pull(githubToken, ghPagesBranch);
} else if (isPrivateRepo && !skipFetchGhPages) {
core.warning(
"'git pull' was skipped. If you want to ensure GitHub Pages branch is up-to-date " +
"before generating a commit, please set 'github-token' input to pull GitHub pages branch",
);
} else {
```

Putting this as an issue first to see what main devs think?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.