DEV Community

loading...

Blame alert: Tags users whose code has been altered

molleer profile image David Möller ・1 min read

My Workflow

GitHub action which tags users whose code has been altered in a PR. It uses git blame to determine who is the author of the code which has changed.

This alerts the specific collaborator responsible of creating the code in the first place and makes him/her pay extra attention.

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

name: CI
on:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.base_ref }}
          fetch-depth: 0
      - name: Blame Alert
        uses: molleer/blame-alert@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

GitHub logo molleer / blame-alert

Gihub action which tags users whose code has been removed in a PR

Blame alert

GitHub action which tags users whose code has been altered in a PR. It uses git blame to determine who is the author of the code which has changed.

Usage

name: CI
on:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.base_ref }}
          fetch-depth: 0
      - name: Blame Alert
        uses: molleer/blame-alert@master
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Example

User1 has made a new PR to a repo which is using molleer/blame-alert. He/she has deleted a few lines of code which User2 had written. When the PR is created, this comment is created by molleer/blame-alert.

example

If User1 only changes the code which he/she has added since before, molleer/blame-alert will not add an alert comment.

Additional Resources / Info

@actions/checkout@v2

Discussion (0)

pic
Editor guide