From fb51e5d0a2b7bd95979f4c9f911038eb30d4b58d Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Thu, 22 Dec 2022 14:03:21 +0100 Subject: [PATCH 1/7] Add shared workflows --- .github/ISSUE_TEMPLATE/bug.yml | 36 ++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 11 ++++++++ .github/PULL_REQUEST_TEMPLATE | 19 ++++++++++++++ .github/config.yml | 24 ++++++++++++++++++ .github/workflows/codeql.yml | 42 +++++++++++++++++++++++++++++++ .github/workflows/idle.yml | 13 ++++++++++ .github/workflows/welcome-bot.yml | 35 ++++++++++++++++++++++++++ 7 files changed, 180 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE create mode 100644 .github/config.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/idle.yml create mode 100644 .github/workflows/welcome-bot.yml diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..846399c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,36 @@ +name: "Bug report" +description: Report an unexpected problem or unintended behavior. +labels: ["needs triage"] +body: + - type: markdown + attributes: + value: | + ### Before you start + + **Want to fix the problem yourself?** This project is open source and we welcome fixes and improvements from the community! + + ↩ Check the project [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) guide to see how to get started. + + --- + - type: textarea + id: problem + attributes: + label: What information was incorrect, unhelpful, or incomplete? + validations: + required: true + - type: textarea + id: expected + attributes: + label: What did you expect to see? + validations: + required: true + - type: textarea + id: references + attributes: + label: Do you have any supporting links, references, or citations? + description: Link to information that helps us confirm your issue. + - type: textarea + id: more-info + attributes: + label: Do you have anything more you want to share? + description: For example, steps to reproduce a bug, screenshots, screen recordings, or sample code diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..a7dab48 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: true +contact_links: + - name: MDN GitHub Discussions + url: https://github.com/orgs/mdn/discussions + about: Does the issue involve a lot of pages, or are you not sure how it can be split into actionable tasks? Consider starting a discussion first. + - name: MDN Web Docs on Discourse + url: https://discourse.mozilla.org/c/mdn/learn/250 + about: Need help with assessments on MDN Web Docs? We have a support community for this purpose on Discourse. + - name: Help with code + url: https://stackoverflow.com/ + about: If you are stuck and need help with code, StackOverflow is a great resource. diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE new file mode 100644 index 0000000..14435af --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE @@ -0,0 +1,19 @@ + + +### Description + + + +### Motivation + + + +### Additional details + + + +### Related issues and pull requests + + + + diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 0000000..6966b6c --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,24 @@ +# Configuration for welcome - https://github.com/behaviorbot/welcome +# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome + +# Comment to be posted to on first time issues +newIssueWelcomeComment: > + 👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. + +# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome +# Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: > + 💖 Thanks for opening this pull request! 💖 + + Here is a list of things that will help get it across the finish line: + + - If this is a new or updated CSS interactive example, please ensure that you followed the [CSS styleguide](https://github.com/mdn/interactive-examples/blob/main/CSS-Example-Style-Guide.md) + - If this is a new or updated JavaScript interactive example, please ensure that you followed the [JavaScript styleguide](https://github.com/mdn/interactive-examples/blob/main/JS-Example-Style-Guide.md) + - If your changes affects any of the steps in our [contribution docs](https://github.com/mdn/interactive-examples/blob/main/CONTRIBUTING.md), please also make the relevant changes there. + +# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge +# Comment to be posted to on pull requests merged by a first time user +firstPRMergeComment: > + Congrats on merging your first pull request! 🎉🎉🎉 + +# It is recommend to include as many gifs and emojis as possible diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..0c4086e --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,42 @@ +name: "CodeQL" + +on: + push: + branches: ["main"] + paths-ignore: + - "**.md" + pull_request: + # The branches below must be a subset of the branches above + branches: ["main"] + paths-ignore: + - "**.md" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + matrix: + # Add the language(s) you want to analyze here as an array of strings + # for example: ['javascript'] or ['python', 'javascript'] + language: ["javascript"] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/idle.yml b/.github/workflows/idle.yml new file mode 100644 index 0000000..38ceb3a --- /dev/null +++ b/.github/workflows/idle.yml @@ -0,0 +1,13 @@ +# This workflow is hosted at: https://github.com/mdn/workflows/blob/main/.github/workflows/idle.yml +# Docs for this workflow: https://github.com/mdn/workflows/blob/main/README.md#idle +name: "Label idle issues" + +on: + schedule: + - cron: "0 8 * * *" + +jobs: + mark-as-idle: + uses: mdn/workflows/.github/workflows/idle.yml@main + with: + target-repo: "mdn/webextensions-examples" diff --git a/.github/workflows/welcome-bot.yml b/.github/workflows/welcome-bot.yml new file mode 100644 index 0000000..739f8aa --- /dev/null +++ b/.github/workflows/welcome-bot.yml @@ -0,0 +1,35 @@ +# This workflow is hosted at: https://github.com/mdn/workflows/blob/main/.github/workflows/allo-allo.yml +# Docs for this workflow: https://github.com/mdn/workflows/blob/main/README.md#allo-allo +name: "AlloAllo" + +on: + issues: + types: + - opened + pull_request_target: + branches: + - main + types: + - opened + - closed + +jobs: + allo-allo: + uses: mdn/workflows/.github/workflows/allo-allo.yml@main + with: + target-repo: "mdn/todo-vue" + issue-welcome: | + It looks like this is your first issue. Welcome! 👋 + One of the project maintainers will be with you as soon as possible. We + appreciate your patience. To safeguard the health of the project, please + take a moment to read our [code of conduct](../blob/main/CODE_OF_CONDUCT.md). + pr-welcome: | + It looks like this is your first pull request. 🎉 + Thank you for your contribution! One of the project maintainers will triage + and assign the pull request for review. We appreciate your patience. To + safeguard the health of the project, please take a moment to read our + [code of conduct](../blob/main/CODE_OF_CONDUCT.md). + pr-merged: | + Congratulations on your first merged pull request. 🎉 Thank you for your contribution! + Did you know we have a [project board](https://github.com/orgs/mdn/projects/25) with high-impact contribution opportunities? + We look forward to your next contribution. From 461f4a4aa1371f0ed8cd56eb7c42e52dd4802ab5 Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Thu, 22 Dec 2022 14:05:46 +0100 Subject: [PATCH 2/7] Add editorconfig and Prettier config --- .editorconfig | 15 +++++++++++++++ .prettierrc.json | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 .editorconfig create mode 100644 .prettierrc.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..afc63ba --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..9c1044f --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "bracketSameLine": true +} From f8350be31b0d4cef9e193b559f12ad644372991e Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Tue, 27 Dec 2022 14:44:58 +0100 Subject: [PATCH 3/7] Update welcome-bot.yml Update placeholder with target repo name --- .github/workflows/welcome-bot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/welcome-bot.yml b/.github/workflows/welcome-bot.yml index 739f8aa..08acfb2 100644 --- a/.github/workflows/welcome-bot.yml +++ b/.github/workflows/welcome-bot.yml @@ -17,7 +17,7 @@ jobs: allo-allo: uses: mdn/workflows/.github/workflows/allo-allo.yml@main with: - target-repo: "mdn/todo-vue" + target-repo: "mdn/webextensions-examples" issue-welcome: | It looks like this is your first issue. Welcome! 👋 One of the project maintainers will be with you as soon as possible. We From 83fa8830f0d80d9a0dd81d6f123f8ac3526e3b07 Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Tue, 3 Jan 2023 10:39:03 +0100 Subject: [PATCH 4/7] Delete config.yml This is not needed in the current welcome bot -> https://github.com/mdn/workflows/blob/main/.github/workflows/allo-allo.yml --- .github/config.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/config.yml diff --git a/.github/config.yml b/.github/config.yml deleted file mode 100644 index 6966b6c..0000000 --- a/.github/config.yml +++ /dev/null @@ -1,24 +0,0 @@ -# Configuration for welcome - https://github.com/behaviorbot/welcome -# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome - -# Comment to be posted to on first time issues -newIssueWelcomeComment: > - 👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. - -# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome -# Comment to be posted to on PRs from first time contributors in your repository -newPRWelcomeComment: > - 💖 Thanks for opening this pull request! 💖 - - Here is a list of things that will help get it across the finish line: - - - If this is a new or updated CSS interactive example, please ensure that you followed the [CSS styleguide](https://github.com/mdn/interactive-examples/blob/main/CSS-Example-Style-Guide.md) - - If this is a new or updated JavaScript interactive example, please ensure that you followed the [JavaScript styleguide](https://github.com/mdn/interactive-examples/blob/main/JS-Example-Style-Guide.md) - - If your changes affects any of the steps in our [contribution docs](https://github.com/mdn/interactive-examples/blob/main/CONTRIBUTING.md), please also make the relevant changes there. - -# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge -# Comment to be posted to on pull requests merged by a first time user -firstPRMergeComment: > - Congrats on merging your first pull request! 🎉🎉🎉 - -# It is recommend to include as many gifs and emojis as possible From 83764b3002a6180c3dd68d90345ca7fc991940a4 Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Tue, 3 Jan 2023 13:45:04 +0100 Subject: [PATCH 5/7] chore(docs): Fix templates --- .github/ISSUE_TEMPLATE/config.yml | 5 ++++- .github/workflows/welcome-bot.yml | 6 +++--- CODE_OF_CONDUCT.md | 12 ++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index a7dab48..03d9f6c 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,11 @@ blank_issues_enabled: true contact_links: + - name: Content or feature request + url: https://github.com/mdn/mdn/issues/new/choose + about: Propose new content for MDN Web Docs or submit a feature request using this link. - name: MDN GitHub Discussions url: https://github.com/orgs/mdn/discussions - about: Does the issue involve a lot of pages, or are you not sure how it can be split into actionable tasks? Consider starting a discussion first. + about: Does the issue involve a lot of changes, or is it hard to split it into actionable tasks? Start a discussion before opening an issue. - name: MDN Web Docs on Discourse url: https://discourse.mozilla.org/c/mdn/learn/250 about: Need help with assessments on MDN Web Docs? We have a support community for this purpose on Discourse. diff --git a/.github/workflows/welcome-bot.yml b/.github/workflows/welcome-bot.yml index 08acfb2..bd64dd7 100644 --- a/.github/workflows/welcome-bot.yml +++ b/.github/workflows/welcome-bot.yml @@ -18,18 +18,18 @@ jobs: uses: mdn/workflows/.github/workflows/allo-allo.yml@main with: target-repo: "mdn/webextensions-examples" - issue-welcome: | + issue-welcome: > It looks like this is your first issue. Welcome! 👋 One of the project maintainers will be with you as soon as possible. We appreciate your patience. To safeguard the health of the project, please take a moment to read our [code of conduct](../blob/main/CODE_OF_CONDUCT.md). - pr-welcome: | + pr-welcome: > It looks like this is your first pull request. 🎉 Thank you for your contribution! One of the project maintainers will triage and assign the pull request for review. We appreciate your patience. To safeguard the health of the project, please take a moment to read our [code of conduct](../blob/main/CODE_OF_CONDUCT.md). - pr-merged: | + pr-merged: > Congratulations on your first merged pull request. 🎉 Thank you for your contribution! Did you know we have a [project board](https://github.com/orgs/mdn/projects/25) with high-impact contribution opportunities? We look forward to your next contribution. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 50e26b1..bd86da5 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,8 +1,8 @@ -# Community Participation Guidelines +# Code of conduct -This repository is governed by Mozilla's code of conduct and etiquette guidelines. -For more details, please read the -[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/). +This repository is governed by Mozilla's code of conduct and etiquette guidelines. +For more details, read [Mozilla's Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/). -## How to Report -For more information on how to report violations of the Community Participation Guidelines, please read our [How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/) page. +## Reporting violations + +For more information on how to report violations of the Community Participation Guidelines, read the [How to report](https://www.mozilla.org/about/governance/policies/participation/reporting/) page. From 2bb5e55e1429825c931beec54cb1b6ef09ba08ac Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Tue, 3 Jan 2023 13:52:18 +0100 Subject: [PATCH 6/7] chore(docs): Fix templates --- .github/ISSUE_TEMPLATE/bug.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 846399c..091d81b 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,4 +1,4 @@ -name: "Bug report" +name: "Issue report" description: Report an unexpected problem or unintended behavior. labels: ["needs triage"] body: @@ -33,4 +33,4 @@ body: id: more-info attributes: label: Do you have anything more you want to share? - description: For example, steps to reproduce a bug, screenshots, screen recordings, or sample code + description: For example, steps to reproduce, screenshots, screen recordings, or sample code. From 71ed91ff2411e5c0b506fbbf6234df7e6e5d4dbe Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Tue, 3 Jan 2023 15:02:26 +0100 Subject: [PATCH 7/7] chore(tooling): reset Prettier config to allow the project to define settings --- .prettierrc.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.prettierrc.json b/.prettierrc.json index 9c1044f..0967ef4 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,3 +1 @@ -{ - "bracketSameLine": true -} +{}