Skip to content

Add GitHub Actions workflow to ensure new features are correctly named and documented #4493

Closed

Description

@fregante

Add workflow to ensure that PRs with titles like add xyz feature, include a file called xyz.tsx and add a line with xyz in readme.md. If they aren't found in the diff, it should fail.

This would have prevented this: #4483 (comment)

And also fixes: #4320 (comment)

Possible starting point, pseudo-code:

name: New feature checker

on:
  pull_request:
    types: [opened, edited]

jobs:
  checker:
    runs-on: ubuntu-latest
    if: contains(github.event.pr.title, 'Add') && contains(github.event.pr.title, 'feature')
    steps:
      - use: actions/checkout@v2
      - name: Find feature name
        id: feature 
        uses: AsasInnab/regex-action@v1
        with:
          regex_pattern: (?<=Add `)\w+(?=` feature)'
          search_string: github.event.pr.title
      - name: Has ${{ steps.feature.outputs.first_match }}.tsx been created?
        uses: mudlabs/[email protected]
        with:
          path: source/features/${{ steps.feature.outputs.first_match }}.tsx 
      - name: Has the file been imported
        run: grep ${{ steps.feature.outputs.first_match }} source/refined-github.ts -q
      - name: Has the feature been documented
        run: grep ${{ steps.feature.outputs.first_match }} readme.md -q

Activity

  1. added
    meta
    small
    on Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedmetasmall

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions