Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug: Is CTA adding more checks than there are workflows for it? #1171

Closed
3 tasks done
johnnyreilly opened this issue Jan 1, 2024 · 2 comments · Fixed by #1310
Closed
3 tasks done

🐛 Bug: Is CTA adding more checks than there are workflows for it? #1171

johnnyreilly opened this issue Jan 1, 2024 · 2 comments · Fixed by #1310
Labels
status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(

Comments

@johnnyreilly
Copy link
Collaborator

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

Heya!

So I'm hacking away at my side project here: johnnyreilly/schemar#1

And I noticed on the PR that there were checks for workflows that I don't have in my repo; a bunch of the lint_knip / lint_markdown etc workflows

Given I don't have those in my repo, I was surprised they showed up in GitHub. Regrettably I can't remember if those workflow files originally existed or if I deleted them. (Makes me think it'd be handy to have a metadata file that shows how a project was initialised or something)

Actual

screenshot of github showing checks that don't have corresponding workflows

Additional Info

This might be user error; not sure.

@johnnyreilly johnnyreilly added the type: bug Something isn't working :( label Jan 1, 2024
@JoshuaKGoldberg JoshuaKGoldberg added status: needs investigation Further research required...? status: accepting prs Please, send a pull request to resolve this! and removed status: needs investigation Further research required...? labels Jan 2, 2024
@JoshuaKGoldberg
Copy link
Owner

Ah, yes, this is a bug. Good catch. Workflow files are created conditionally based on options:

...(!options.excludeLintKnip && {
"lint-knip.yml": createWorkflowFile({

...but branch protection settings are all always created:

required_status_checks: {
checks: [
{ context: "build" },
{ context: "compliance" },
{ context: "lint" },
{ context: "lint_knip" },

The initializeBranchProtectionSettings function should be updated to only create branch protections needed per options. Thanks for filing!

JoshuaKGoldberg added a commit that referenced this issue Feb 15, 2024
## PR Checklist

- [x] Addresses an existing open issue: fixes #1171
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

This way, when creating/initializing/migrating a repository, branch
protection settings won't be created for excluded options' CI flows.
Copy link

🎉 This is included in version v1.57.7 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants