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

Proposal to automate approval flow for "built-with-eleventy" issues #614

Open
Snapstromegon opened this issue Apr 11, 2024 · 1 comment
Open

Comments

@Snapstromegon
Copy link
Member

Most of the time I've been spending on 11ty this year was in this repo, manually approving all the awesome submissions by people.

My process for this up until now is to check whether either the <meta name="generator" content="Eleventy"> tag was present in the linked page or an Eleventy config file exists in the linked repo.
At the same time I have very little time to write a welcoming message as a response to the repo.

For this reason I propose the following steps to automate the approval process:

  1. Add two labels "bwe-config-exists" and "bwe-generator-exists" (bwe means built-with-eleventy)
  2. Create a GH action which checks for those two things and automatically applies these labels to all issues when created
  3. check validity by searching for collisions in existing data and/or best effort detect of unwanted content (e.g. what is our policy around NSFW or politically extremist content?)
  4. (optionally) automatically approve submissions if they have at least one or both labels.
  5. write a nice comment under the issue to welcome the submission

I'd be willing to implement at least step 1, 2, (4) and 5 as an Action which we could move under the GitHub 11ty Org.

The generator detection could work something like this:

const hasMetaGenerator11ty = async (url) => {
  const resp = await fetch(url);
  const html = await resp.text();
  const metaGenerator = cssSelect.selectOne(
    "meta[name='generator']",
    htmlparser2.parseDocument(html)
  );
  return (
    metaGenerator?.attribs?.content.toLowerCase().includes("eleventy") ||
    metaGenerator?.attribs?.content.toLowerCase().includes("11ty") ||
    false
  );
};
@Snapstromegon
Copy link
Member Author

(mentioning @zachleat so it doesn't get lost)

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

No branches or pull requests

1 participant