Giter Club home page Giter Club logo

.github's Introduction

.github

This repo contains items that are shared by all repositories in the fosslight org.

.github's People

Contributors

yenawee avatar gseungmin avatar bjk7119 avatar jongwooo avatar

Stargazers

Dabeen Jeong avatar  avatar

Watchers

Soim avatar

Forkers

gseungmin

.github's Issues

Divide and abstract complex workflows

proposal: Divide and abstract complex workflows

Important

Do not link a pull request to this issue(e.g. Closes #1).

Currently, as we look at the repository in our org, each workflow is written in a messy way.
For example, the check-commit-message workflow is a duplicate of the same code for each repository.

check-commit-message:
  name: Check Commit Message
  runs-on: ubuntu-latest
  steps:
    - name: Get PR Commits
      id: 'get-pr-commits'
      uses: tim-actions/get-pr-commits@master
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
    - name: Check Subject Line Length
      uses: tim-actions/[email protected]
      with:
        commits: ${{ steps.get-pr-commits.outputs.commits }}
        pattern: '^.{0,50}(\n.*)*$'
        error: 'Subject too long (max 50)'
    - name: Check Body Line Length
      if: ${{ success() || failure() }}
      uses: tim-actions/[email protected]
      with:
        commits: ${{ steps.get-pr-commits.outputs.commits }}
        pattern: '^.+(\n.{0,72})*$'
        error: 'Body line too long (max 72)'

Duplicate workflows make maintenance difficult and increase the potential for human error.

Rather than using workflow files for each trigger event, we should separate them by functionality and see what we can abstract away along the way.

Abstract check-commit-message workflow

Is your feature request related to a problem? Please describe.

  • The current workflows have a significant amount of redundancy in checking commit messages.
  • I am planning to abstract and refine the workflow by separating the code from repositorys in fosslight
  • Related Issue: #1

Describe the solution you'd like

  • I want to separate the following code from repositorys in fosslight and manage it in .git repository.
check-commit-message:
  name: Check Commit Message
  runs-on: ubuntu-latest
  steps:
    - name: Get PR Commits
      id: 'get-pr-commits'
      uses: tim-actions/get-pr-commits@master
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
    - name: Check Subject Line Length
      uses: tim-actions/[email protected]
      with:
        commits: ${{ steps.get-pr-commits.outputs.commits }}
        pattern: '^.{0,50}(\n.*)*$'
        error: 'Subject too long (max 50)'
    - name: Check Body Line Length
      if: ${{ success() || failure() }}
      uses: tim-actions/[email protected]
      with:
        commits: ${{ steps.get-pr-commits.outputs.commits }}
        pattern: '^.+(\n.{0,72})*$'
        error: 'Body line too long (max 72)'

Additional context

  • Please compare the difference between before and after

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.