Giter Club home page Giter Club logo

impower-code-cleanup's Introduction

Usage

1. Create a new Workflow

Create a new file in the repository under the following path:

.github/workflows/example.yml

2.1 Copy Template A (without Repository Checks):

# This workflow will run the Impower.AI code cleanup using the Impower Code Standards (https://github.com/impower-ai/impower-code-standards)

name: ReSharper Code Cleanup using Impower Code Standards

on:
  pull_request:
    types: [ closed ]
    branches: [ "main" ]

jobs:
  impower-code-cleanup:
    uses: impower-ai/impower-code-cleanup/.github/workflows/impower-code-cleanup.yml@main
    with:
      auto_merge: true
      #nuget_sources: '["https://your-server.com/index.json", "https://your-other-server.com/index.json"]'
    secrets:
      PAT: ${{ secrets.STANDARDS_PAT }}

or

2.2 Copy Template B (with Repository Checks):

# This workflow will run the Impower.AI code cleanup using the Impower Code Standards (https://github.com/impower-ai/impower-code-standards) 
while also performing various checks on the target repository/branch

name: ReSharper Code Cleanup using Impower Code Standards

on:
  pull_request:
    types: [ closed ]
    branches: [ "main" ]

jobs:
  impower-repository-checks:
    uses: impower-ai/impower-code-cleanup/.github/workflows/impower-repository-checks.yml@main
    with:
      #fail_on_unprotected: true
      branch: "main"
    secrets:
      PAT: ${{ secrets.STANDARDS_PAT }}

  impower-code-cleanup:
    needs: impower-repository-checks
    uses: impower-ai/impower-code-cleanup/.github/workflows/impower-code-cleanup.yml@main
    with:
      auto_merge: true
      #nuget_sources: '["https://your-server.com/index.json", "https://your-other-server.com/index.json"]'
    secrets:
      PAT: ${{ secrets.STANDARDS_PAT }}

3. Adjust inputs & secrets

Repository Checks

fail_on_unprotected Optional (default: false)
true If the branch is not protected, the workflow fails and stops the chain.
false Branch Protection is ignored and the chain continues.

branch Required
string The name of the branch to check for Branch Protection Rules.

PAT Required
A personal access token that has permissions to check the repositories Branch Protection Rules (most likely the same PAT as below).

Code Cleanup

auto_merge Required
true The resulting PR will automatically be merged and the temporary branch deleted.
false Do not merge automatically (the PR has to be reviewed manually).

PAT Required
A personal access token that has permissions to clone the standards repository and create the pull request along with its branch.

nuget_sources Optional
Pass any NuGet package source URLs as a JSON string array.
You do not have to pass this value if you're not using any additional NuGet sources.



Note:

The default branch naming conventions have changed:
You might have to change the branch for the activation from "main" to "master" if your repository was created a while ago.

impower-code-cleanup's People

Contributors

botondberes avatar

Stargazers

 avatar

Watchers

 avatar

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.