Code Monkey home page Code Monkey logo

duster-action's Introduction

Project Banner

GitHub Action for Tighten Duster

GitHub Action for the Tighten Duster package.

If your project requires PHP 8.0 use tighten/duster-action@v1 which pulls in Duster 1.x.

Usage

Use with GitHub Actions

# .github/workflows/duster.yml
name: Duster

on:
    push:
        branches: main
    pull_request:

jobs:
  duster:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: "duster"
        uses: tighten/duster-action@v2
        with:
          args: lint

To use additional Duster options use args:

# .github/workflows/duster.yml
name: Duster

on:
    push:
        branches: main
    pull_request:

jobs:
  duster:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: "duster"
        uses: tighten/duster-action@v2
        with:
          args: lint --using=tlint,pint

If you would like to automatically commit any required fixes you can add the Git Auto Commit Action by Stefan Zweifel.

# .github/workflows/duster.yml
name: Duster Fix

on:
    push:
        branches: main
    pull_request:

jobs:
  duster:
    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}

      - name: "duster"
        uses: tighten/duster-action@v2
        with:
          args: fix

      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Dusting
          commit_user_name: GitHub Action
          commit_user_email: [email protected]

Note The resulting commit will not trigger another GitHub Actions Workflow run. This is due to limitations set by GitHub.

To get around this you can indicate a workflow should run after "Duster Fix" using the workflow_run option.

on:
    workflow_run:
        workflows: ["Duster Fix"]
        types:
          - completed

The name "Duster Fix" must match the name defined in your Duster workflow and must be on the default branch.

Be sure to check out the action's documentation for limitations and options.


To automatically ignore these commits from GitHub's git blame you can add the commit's hash to a .git-blame-ignore-revs file.

# .github/workflows/duster.yml
name: Duster Fix

on:
    push:
        branches: main
    pull_request:

jobs:
  duster:
    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}

      - name: "Duster Fix"
        uses: tighten/duster-action@v2
        with:
          args: fix

      - uses: stefanzweifel/git-auto-commit-action@v4
        id: auto_commit_action
        with:
          commit_message: Dusting
          commit_user_name: GitHub Action
          commit_user_email: [email protected]

      - name: Ignore Duster commit in git blame
        if: steps.auto_commit_action.outputs.changes_detected == 'true'
        run: echo ${{ steps.auto_commit_action.outputs.commit_hash }} >> .git-blame-ignore-revs

      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Ignore Dusting commit in git blame
          commit_user_name: GitHub Action
          commit_user_email: [email protected]

duster-action's People

Contributors

driftingly avatar tonysm 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.