Git Product home page Git Product logo

actions-qa-labels's Introduction

actions-qa-labels

A GitHub action to automatically add labels to pull requests based on QA report comments.

Installation in repositories

Add this to your workflow file (e.g. .github/workflows/qa-labels-for-prs.yml):

on: issue_comment

jobs:
  pr_commented:
    name: "QA Labels for PRs"
    if: ${{ github.event.issue.pull_request }} # This job only runs for pull request comments 
    runs-on: "ubuntu-latest" 
    permissions: # This is required for the action to be able to add labels to the pull request
      pull-requests: write # For adding labels, otherwise set to 'read'
    steps:
      - name: "PR QA Comments Labeler"
        uses: "flybywiresim/actions-qa-labels@master" # Make sure to use the latest version available!
        with:
          repo-owner: "${{ github.event.repository.owner.login }}" # Do not change this - this will automatically be set to the owner of the repository
          repo-name: "${{ github.event.repository.name }}" # Do not change this - this will automatically be set to the name of the repository
          pr-number: "${{ github.event.issue.number }}" # Do not change this - this will automatically be set to the number of the pull request
          github-token: "${{ secrets.GITHUB_TOKEN }}" # Do not change this - this will automatically be set to the GITHUB_TOKEN secret so that the action can add labels to the pull request - if you want to use a personal access token instead (e.g. for a bot), you can set it here
          label-pass: "QA Passed" # The label to add if the QA report comment contains the string "QA Passed"
          label-fail: "QA Failed" # The label to add if the QA report comment contains the string "QA Failed"
          label-rtt: "QA Ready to Test" # The label to add if the QA report comment contains the string "QA Ready to Test"
          # fail-action-if-no-qacomment: true # Uncomment this line if you want the action to fail if there is no QA report comment
          # fail-action-if-qa-failed: true # [Recommended] Uncomment this line if you want the action to fail if the QA report comment contains the string "QA Failed" 

Configuration Details

  • repo-owner The owner of the repository. This will automatically be set to the owner of the repository, so you don't need to change this. Default: ${{ github.event.repository.owner.login }} Required: Yes Accepts: string

  • repo-name The name of the repository. This will automatically be set to the name of the repository, so you don't need to change this. Default: ${{ github.event.repository.name }} Required: Yes Accepts: string

  • pr-number The number of the pull request. This will automatically be set to the number of the pull request, so you don't need to change this. Default: ${{ github.event.issue.number }} Required: Yes Accepts: string

  • github-token The GitHub token to use for adding labels to the pull request. This will automatically be set to the GITHUB_TOKEN secret, so you don't need to change this. If you want to use a personal access token instead for your own account or using a bot account, you can set it here. Default: ${{ secrets.GITHUB_TOKEN }} Required: Yes Accepts: string

  • label-pass The label to add if the QA report comment contains the string "QA Passed". Recommended: QA Passed Required: No Accepts: string

  • label-fail The label to add if the QA report comment contains the string "QA Failed". Recommended: QA Failed Required: No Accepts: string

  • label-rtt The label to add if the QA report comment contains the string "QA Ready to Test". Recommended: QA Ready to Test Required: No Accepts: string

  • fail-action-if-no-qacomment Whether to fail the action if there is no QA report comment - useful if you want to make sure that the QA report comment is added for every pull request. Default: false Required: No Accepts: boolean

  • fail-action-if-qa-failed Whether to fail the action if the QA report comment contains the string "QA Failed" - useful if you want to make sure that the QA report comment is added for every pull request. Default: false Required: No Accepts: boolean

Usage in a repository

This action will automatically add labels to pull requests based on QA report comments.

The wording requirements are based on the https://docs.flybywiresim.com/dev-corner/qa-process/#reporting-on-tests template. If the action is not working, ensure you are following the template.

Building

If you want to build this action yourself, you can do so by running npm run build in the root directory of this project. This will create a dist folder with the built action.

Please note that the build script requires ncc to be installed globally, you can install it by running npm install -g @vercel/ncc.


If you have questions about this repo, using it, etc. contact @alepouna on the FBW Discord :) actions-qa-labels is originally based on https://github.com/auroraisluna/qa-labels-for-prs licensed under GNU GENERAL PUBLIC LICENSE v3.

actions-qa-labels's People

Contributors

vulpesfeggari avatar kiwi2021 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.