Code Monkey home page Code Monkey logo

alssndro / turn-off-pr-comments-for-test-summary-github-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eloisetaylor5693/turn-off-pr-comments-for-test-summary-github-action

0.0 0.0 0.0 32 KB

GitHub Action to turn off PR comments if user is in github team for the test summary github action

Home Page: https://github.com/marketplace/actions/turn-off-the-test-summary-pr-comments-if-a-user-is-in-a-specified-github-team

License: MIT License

turn-off-pr-comments-for-test-summary-github-action's Introduction

GitHub Action to turn off PR comments if user is in github team for the test summary github action

Turn off PR comments if a user is in a specified github team.

What?

This action extends the github action: EnricoMi/publish-unit-test-result-action to allow you to suppress comments on PRs for users who join a github team.

Why?

It seems that the behaviour to comment PRs when tests fail was quite contriversial in my department! Some devs found it really useful, others found it really annoying.

Therefore rather than having to turn off for everyone and some miss out on the value, or turned on for everyone and annoy people this action solves that.

How to use

  1. Set up a new Github Team for users to join who want to switch off the comments for their PR
  2. Add this action
  - name: Turn off PR comments for users in 'Suppress PR test summary comments'
    uses: eloisetaylor5693/[email protected]
    id: suppress-pr-comments-for-some-users
    with:
      default_comment_mode: 'failures'
      github_organisation: 'my-org'
      github_team_for_switching_off_comments: 'Suppress PR test summary comments'
      github_token: ${{ secrets.github_token }}
  1. Use the test_summary_comment_mode output when using EnricoMi/publish-unit-test-result-action
 - name: Publish test results
    uses: EnricoMi/publish-unit-test-result-action@v2
    if: always()
    with:
      files: *.xml
      comment_mode: ${{ steps.suppress-pr-comments-for-some-users.outputs.test_summary_comment_mode }}
      check_name: "Tests"

Input Options

Option Default Value Description
default_comment_mode "failures" The comment mode to use when a commit author isn't in any Github Teams for suppressing comments on the PR.
github_token ${{github.token}} An alternative GitHub token, other than the default provided by GitHub Actions runner.
github_team_for_switching_off_comments "Suppress PR test summary comments" Github Team users can join to suppress comments on their PR.
github_organisation ${{ github.repository_owner }} Github Organisation the team is part of.

Output

test_summary_comment_mode: is either the default you gave for the input default_comment_mode or off

Contributing

See https://github.com/eloisetaylor5693/turn-off-pr-comments-for-test-summary-github-action/blob/main/CONTRIBUTING.md

turn-off-pr-comments-for-test-summary-github-action's People

Contributors

alssndro avatar eloisetaylor5693 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.