From fd39a4d7a9245163ac8a8fae0b4aa7839d6c0148 Mon Sep 17 00:00:00 2001 From: Michael Lombardi Date: Fri, 4 Nov 2022 09:34:31 -0500 Subject: [PATCH] (AB#30884) Configure quality contributions project This change configures the repository for participation in the PowerShell Docs Quality Contributions project, replacing the Hacktoberfest issue template with one for the new project and setting up workflow automation. - Fixes AB#30884 --- .github/ISSUE_TEMPLATE/00-hacktoberfest.yml | 78 ------------------- .github/ISSUE_TEMPLATE/00-quality.yml | 85 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 8 +- .github/workflows/quality.issue.yml | 75 ++++++++++++++++++ .github/workflows/quality.pr.yml | 39 ++++++++++ 5 files changed, 203 insertions(+), 82 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/00-hacktoberfest.yml create mode 100644 .github/ISSUE_TEMPLATE/00-quality.yml create mode 100644 .github/workflows/quality.issue.yml create mode 100644 .github/workflows/quality.pr.yml diff --git a/.github/ISSUE_TEMPLATE/00-hacktoberfest.yml b/.github/ISSUE_TEMPLATE/00-hacktoberfest.yml deleted file mode 100644 index e04511b..0000000 --- a/.github/ISSUE_TEMPLATE/00-hacktoberfest.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: "🎃 Hacktoberfest 2022" -description: >- - File a new issue to tackle quality improvement opportunities for Hacktoberfest 2022 -title: "🎃 2022: " -body: - - type: markdown - attributes: - value: | - This issue's related to [Hacktoberfest 2022][01]. For more info, see the meta-issue below: - - - MicrosoftDocs/PowerShell-Docs#9257 - - [01]: https://hacktoberfest.com/participation/ - - type: checkboxes - id: prerequisites - attributes: - label: Prerequisites - description: >- - These steps are required. After you've completed each step, check the box for it before - moving on. - options: - - label: >- - **Existing Issue:** Search the existing Hacktoberfest issues for this repository. If - there's an issue that covers the quality area and articles you want to improve, pick a - different quality area or article set. Don't file a new issue for the same work. - Subscribe, react, or comment on that issue instead. - required: true - - label: >- - **Descriptive Title:** Write the title for this issue as a short synopsis. If possible, - provide context. For example, "🎃 2022: Command Syntax in Foo" instead of "🎃 2022: Foo" - required: true - - type: dropdown - id: QualityArea - validations: - required: true - attributes: - label: Quality Areas - description: | - Select one or more quality areas to improve on with your contribution. - - For more information, see the relevant section in the meta issue: - - - [Aliases][aliases]: Ensure cmdlet aliases are documented - - [Formatting code samples][code-samples]: Ensure proper casing, line length, etc in code samples - - [Formatting command syntax][command-syntax]: Ensure proper casing and formatting for command syntax, including cmdlets, types, etc. - - [Link References][link-refs]: Ensure links in conceptual docs are defined as numbered references - - [Markdown linting][md-linting]: Ensure content follows markdownlint rules - - [Spelling][spelling]: Ensure proper casing and spelling for words - - [aliases]: https://github.com/MicrosoftDocs/PowerShell-Docs/issues/9257#aliases - [code-samples]: https://github.com/MicrosoftDocs/PowerShell-Docs/issues/9257#formatting-code-samples - [command-syntax]: https://github.com/MicrosoftDocs/PowerShell-Docs/issues/9257#formatting-command-syntax - [link-refs]: https://github.com/MicrosoftDocs/PowerShell-Docs/issues/9257#link-references - [md-linting]: https://github.com/MicrosoftDocs/PowerShell-Docs/issues/9257#markdown-linting - [spelling]: https://github.com/MicrosoftDocs/PowerShell-Docs/issues/9257#spelling - multiple: true - options: - - Aliases - - Formatting code samples - - Formatting command syntax - - Link References - - Markdown linting - - Spelling - - type: textarea - id: ArticleList - validations: - required: true - attributes: - label: Article List - description: >- - Specify the articles you are committing to work on, one per line. You can specify each entry - as a path, the article's title, or the link to the article on Learn. If you specify an - article by path for a reference article, such as a cmdlet or about topic, specify the - version segment as `*.*`. - placeholder: | - - reference/*.*/Microsoft.PowerShell.Core/Add-History.md - - Add-History - - https://learn.microsoft.com/powershell/module/microsoft.powershell.core/add-history diff --git a/.github/ISSUE_TEMPLATE/00-quality.yml b/.github/ISSUE_TEMPLATE/00-quality.yml new file mode 100644 index 0000000..b91613e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/00-quality.yml @@ -0,0 +1,85 @@ +name: "🛠️ Quality Contribution" +description: >- + File a new issue to tackle quality improvement opportunities +title: "Quality: " +body: + - type: markdown + attributes: + value: | + This issue template is for the [PowerShell Docs Quality Contributions project][a1]. + + For more more info, see [Contributing quality improvements][a2] in our Contributor's Guide. + + [a1]: https://github.com/orgs/MicrosoftDocs/projects/15 + [a2]: https://learn.microsoft.com/powershell/scripting/community/contributing/quality-improvements + - type: checkboxes + id: prerequisites + attributes: + label: Prerequisites + description: >- + These steps are required. After you've completed each step, check the box for it before + moving on. + options: + - label: | + **Existing Issue:** + + Search the existing [quality issues][b1] for this repository. If there's an issue that + covers the quality area and articles you want to improve, pick a different quality area + or article set. Don't file a new issue for the same work. Subscribe, react, or comment + on that issue instead. + + [b1]: https://github.com/orgs/MicrosoftDocs/projects/15/views/3?filterQuery=repo%3A%22MicrosoftDocs%2FPowerShell-Docs-Modules%22+is%3Aissue + required: true + - label: | + **Descriptive Title:** + + Write the title for this issue as a short synopsis. If possible, provide context. For + example, "Quality: Command Syntax in Foo" instead of "Quality: Foo" + required: true + - type: dropdown + id: QualityArea + validations: + required: true + attributes: + label: Quality Areas + description: | + Select one or more quality areas to improve on with your contribution. + + For more information, see the relevant section in the meta issue: + + - [Aliases][c1]: Ensure cmdlet aliases are documented + - [Formatting code samples][c2]: Ensure proper casing, line length, etc in code samples + - [Formatting command syntax][c3]: Ensure proper casing and formatting for command syntax, including cmdlets, types, etc. + - [Link References][c4]: Ensure links in conceptual docs are defined as numbered references + - [Markdown linting][c5]: Ensure content follows markdownlint rules + - [Spelling][c6]: Ensure proper casing and spelling for words + + [c1]: https://learn.microsoft.com/powershell/scripting/community/contributing/quality-improvements#aliases + [c2]: https://learn.microsoft.com/powershell/scripting/community/contributing/quality-improvements#formatting-code-samples + [c3]: https://learn.microsoft.com/powershell/scripting/community/contributing/quality-improvements#formatting-command-syntax + [c4]: https://learn.microsoft.com/powershell/scripting/community/contributing/quality-improvements#link-references + [c5]: https://learn.microsoft.com/powershell/scripting/community/contributing/quality-improvements#markdown-linting + [c6]: https://learn.microsoft.com/powershell/scripting/community/contributing/quality-improvements#spelling + multiple: true + options: + - Aliases + - Formatting code samples + - Formatting command syntax + - Link References + - Markdown linting + - Spelling + - type: textarea + id: ArticleList + validations: + required: true + attributes: + label: Article List + description: >- + Specify the articles you are committing to work on, one per line. You can specify each entry + as a path, the article's title, or the link to the article on Learn. If you specify an + article by path for a reference article, such as a cmdlet or about topic, specify the + version segment as `*.*`. + placeholder: | + - reference/*.*/Microsoft.PowerShell.Core/Add-History.md + - Add-History + - https://learn.microsoft.com/powershell/module/microsoft.powershell.core/add-history diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index dc42979..33ee651 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,10 +1,10 @@ blank_issues_enabled: false contact_links: - - name: 🎃 Hacktoberfest 2022 - url: https://github.com/MicrosoftDocs/PowerShell-Docs/issues/9257 + - name: Quality Contributions + url: https://learn.microsoft.com/powershell/scripting/community/contributing/quality-improvements about: >- - If you'd like to participate in Hacktoberfest 2022, before filing an issue, check the info - and instructions. + If you'd like to commit to improving quality for the documentation, before filing an issue, + check the info and instructions. - name: PowerShell Product Feedback url: https://github.com/PowerShell/PowerShell/issues/new/choose about: Please open feature requests and bug reports for current PowerShell here. diff --git a/.github/workflows/quality.issue.yml b/.github/workflows/quality.issue.yml new file mode 100644 index 0000000..636d3c0 --- /dev/null +++ b/.github/workflows/quality.issue.yml @@ -0,0 +1,75 @@ +name: "Quality Contribution Issues" +on: + issues: + types: + - opened + +jobs: + # Check if the issue is for quality contributions; all other jobs depend on this one. + quality: + name: Is Quality Contribution? + runs-on: ubuntu-latest + outputs: + check: ${{ steps.is-quality.outputs.match != '' }} + steps: + - uses: actions-ecosystem/action-regex-match@v2 + id: is-quality + with: + text: ${{ github.event.issue.body }} + regex: "Quality: Foo" + flags: gm + + project: + name: Add to project + needs: quality + if: needs.quality.outputs.check == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.3.0 + with: + project-url: https://github.com/orgs/MicrosoftDocs/projects/15/views/1 + github-token: ${{ secrets.quality_token }} + + assign: + name: Assign to author + needs: quality + if: needs.quality.outputs.check == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions-ecosystem/action-add-assignees@v1 + with: + github_token: ${{ secrets.github_token }} + assignees: ${{ github.event.issue.user.login }} + + label: + name: Add quality labels + needs: quality + if: needs.quality.outputs.check == 'true' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - regex: Aliases + label: quality-aliases + - regex: Formatting code samples + label: quality-format-code-samples + - regex: Formatting command syntax + label: quality-format-command-syntax + - regex: Link references + label: quality-link-references + - regex: Markdown linting + label: quality-markdownlint + - regex: Spelling + label: quality-spelling + steps: + - uses: actions-ecosystem/action-regex-match@v2 + id: matcher + with: + text: ${{ github.event.issue.body }} + regex: '^### Quality Areas\s*^.*${{ matrix.regex }}.*$' + flags: gm + - uses: actions-ecosystem/action-add-labels@v1 + if: steps.matcher.outputs.match != '' + with: + labels: ${{ matrix.label }} diff --git a/.github/workflows/quality.pr.yml b/.github/workflows/quality.pr.yml new file mode 100644 index 0000000..ea7e336 --- /dev/null +++ b/.github/workflows/quality.pr.yml @@ -0,0 +1,39 @@ +name: "Quality Contributions" +on: + pull_request_target: + branches: + - main + types: + - opened + - reopened + - edited + +defaults: + run: + shell: pwsh + +jobs: + # Check if the PR is for quality contributions; all other jobs depend on this one. + check: + name: Is Quality Contribution? + outputs: + title: ${{ steps.title.outputs.check == 'true' }} + runs-on: ubuntu-latest + steps: + - id: title + run: | + $Check = "${{ contains(github.event.pull_request.title, 'Quality:') }}" + "Check: $Check" + "::set-output name=check::$Check" + + project: + name: Add pull request to project + needs: check + if: | + needs.check.outputs.title == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.3.0 + with: + project-url: https://github.com/orgs/MicrosoftDocs/projects/15/views/1 + github-token: ${{ secrets.quality_token }}