Skip to content

Automate GitHub repo setup - #148

Merged
WeilerP merged 11 commits into
mainfrom
feat/repo_setup
Sep 8, 2026
Merged

WeilerP merged 11 commits into
mainfrom
feat/repo_setup

Conversation

@WeilerP

@WeilerP WeilerP commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • Update issue templates for bug and features
  • Update READMEs to reflect implemented changes

Bug fixes

  • Fix update command in README.

New

  • Add issue templates for chore, debugging, enhancement, performance, refactor, research
  • Add scripts to set up GitHub automatically

Related issues

Closes #145.

Rename:
- `bug_report.md` > `bug.md`
- `feature_request.md` > `feature.md`

Add templates for chore, debugging, enhancement, performance, refactor
and research issues (matching type label included). The template names
mirror the issue label; templates exists both in the root and generated
project.
If the user is not logged in to `gh`, the script
1. prompts for a PAT when no login exists
2. logs in `gh auth login --with-token`
3. registers `gh` as the git credential helper.

If credentials already exist, the script does not do anything.
The script embedded a PAT in the remote URL, i.e., exposing the secret
in plain text. Now, the script relies on `.gh_auth.sh` to use a
credential-free HTTPS remote and authenticate with `gh`'s credential
helper.
The script
1. creates or edits issue labels to match the labels for which issue
templates exist
2. deletes additional labels by default; retains labels when passing
`--keep-extra-labels`
3. prints a before/after diff on the labels

`hooks/post_gen_project.py` chmods the new script to 0755.
The script allows creating a GitHub repo, set the remote and sync labels
Optionally create the GitHub repo with --create, private by default and
public via --public, then set the remote (`.set_gh_remote.sh`) and sync
labels (`.sync_gh_labels.sh`).

Note:
- creating the repo is optional, i.e., the script works with existing
repos.
- `hooks/post_gen_project.py` chmods the new script to 0755.
Move the status on a project board of every issue a PR closes:
- "In review": the PR is marked ready for review or opened directly as
ready-for-review.
- "Ready": the PR is closed unmerged.

The workflow requires two credentials: `GITHUB_TOKEN` to look up
issues, and `PROJECTS_TOKEN` to access the GitHub project. The
`PROJECT_NUMBER` variable points to the project.
`gh repo create` returns before GitHub finishes provisioning a new
repo's default labels. Syncing immediately made `gh label create`
collide with `wontfix`, the alphabetically last default, aborting the
bootstrap under `set -e`.

Poll the label count after creation until it stops changing. A count
of zero on timeout is harmless, since there is nothing to collide
with, so the wait warns and continues rather than failing.
- refer to project README for steps after generation
- fix the commands for updating generated projects
Update the repo setup section to reflect the latest changes.
- remove redundant bold highlight
- Update setup section to refer to the README
@WeilerP
WeilerP merged commit 64d9122 into main Sep 8, 2026
2 checks passed
@WeilerP
WeilerP deleted the feat/repo_setup branch September 8, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate GitHub repo setup

1 participant