Giter VIP home page Giter VIP logo

repository-naming-convention-action's Introduction

GitHub Repository Naming Convention Action

A GitHub Action that generates a report with all repository names including the date of creation belonging to an organization not matching a set regex string.

Workflow

The example workflow below runs on a weekly schedule and can be executed manually using a workflow_dispatch event.

on:
  workflow_dispatch:
  schedule:
      - cron: '0 0 * * 0' # Once per week at midnight on Sunday

name: Incorrect Naming Convention Report

jobs:
  report:
    runs-on: ubuntu-latest

    steps:

      - name: Checkout
        uses: actions/checkout@v2

      - name: Create Incorrect Naming Convention Report
        uses: nicklegan/repository-naming-convention-action@main
        with:
          token: ${{ secrets.REPO_TOKEN }}
          regex: '^([a-z0-9]+)-([a-z0-9]+)$'
          flags: i

GitHub secrets

Name Value Required
REPO_TOKEN A repo scoped Personal Access Token true
ACTIONS_STEP_DEBUG true Enables diagnostic logging false

Action inputs

Name Description Default Required
regex A regex string matching correct repo naming conventions ^([a-z0-9]+)-([a-z0-9]+)$ true
flags Flag for repo naming regex string. e.g. 'i' for case-insensitive i false
report-path Path within the repository to create the report CSV file reports/incorrect-naming-convention-report.csv false
committer-name The name of the committer to be displayed in the history github-actions false
committer-email The email of the committer to be displayed in the history [email protected] false

Regex examples

Regex example 1: ####-#### (2 fixed groups separated by a dash).

  • ^([a-z0-9]+)-([a-z0-9]+)$

Regex example 2: prefix-####-####-* (3 groups separated by dashes starting with a prefix).

  • ^(prefix)-([a-z0-9]+)-([a-z0-9]+)

Regex example 3: ####-####-####-* (3 groups containing names and numbers divided by dashes).

  • ^([a-z0-9]+)-([a-z0-9]+)-([a-z0-9]+)

As a default the i flag is recommended to allow matches to be case-insensitive

๐Ÿ’ก For more info about regular expressions visit Regular-Expressions.info

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.