GithubHelp home page GithubHelp logo

a7med3bdulbaset / checklist Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1012 KB

GitHub Action to detect checked and unchecked checkboxes in pull request descriptions.

License: MIT License

JavaScript 8.34% TypeScript 91.66%

checklist's Introduction

Checklist Action

GitHub Action to detect checked and unchecked checkboxes in pull request descriptions.

Originally made to be used internally at a project of mine so it's not very flexible. Feel free to fork and adapt it to your needs.

Usage

First create a pull request description with your checkboxes. The action will check or uncheck the checkboxes based on the conditions you specify.

## CI

- [x] format
- [x] lint
- [x] typecheck
- [ ] e2e tests 

This Github Action will check checkbox status in pull request description and output the checked and unchecked checkboxes.

name: Integration Test
on:
  pull_request:

jobs:
  detect:
    runs-on: ubuntu-latest
    outputs:
      checked: ${{ steps.detect.outputs.checked }}
      unchecked: ${{ steps.detect.outputs.unchecked }}

    permissions:
      pull-requests: write

    steps:
      - name: Checkbox Trigger
        id: detect
        uses: a7med3bdulbaset/checklist
        with:
          token: ${{ github.token }}
          # initial PR template to append when no checkboxes are found
          template: |
            ## CI
            - [x] format
            - [x] lint
            - [x] typecheck
            - [ ] e2e tests
            
      - name: list changes
        run: |
          echo "checked=${{ steps.detect.outputs.checked }}"
          echo "unchecked=${{ steps.detect.outputs.unchecked }}

  test:
    name: format
    needs: [detect]
    if: ${{ contains(needs.detect.outputs.checked, 'format') }}
    runs-on: ubuntu-latest
    steps:
      # ...

  lint:
    name: lint
    needs: [detect]
    if: ${{ contains(needs.detect.outputs.checked, 'lint') }}
    runs-on: ubuntu-latest
    steps:
      # ...

The detect step will output two variables in similar format to the following:

checked=format,lint,typecheck
unchecked=e2e tests

Following inputs are available:

  • token: The GitHub token to use for authentication. Usually ${{ github.token }}
  • template: The PR template to use when no checkboxes are found. Leave empty to not update the PR description.

Publish

We use build-and-tag-action to publish a new release. Just push a new tag to the repository and the action will create a new release, including major, minor tags like v1 and v1.0

# increment release number
gh release create

License

Cloned from karlderkaefer/github-action-checkbox-trigger

checklist's People

Contributors

ahmedbaset avatar dependabot[bot] avatar

Stargazers

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