Git Product home page Git Product logo

shopify-cla-action's Introduction

Shopify CLA action

Use case

When activated and configured, a check will be added to every PR making sure your CLA has been signed by all committers. If a committer has not signed your CLA, the check will fail.

After signing the CLA, contributors can comment "I've signed the CLA!" on the PR to re-run the test suite.

This is intended for Shopify repositories only.

Getting Started

Add the following workflow to your repository:

# .github/workflows/cla.yml
name: Contributor License Agreement (CLA)

on:
  pull_request_target:
    types: [opened, synchronize]
  issue_comment:
    types: [created]

jobs:
  cla:
    runs-on: ubuntu-latest
    permissions:
      actions: write
      pull-requests: write
    if: |
      (github.event.issue.pull_request 
        && !github.event.issue.pull_request.merged_at
        && contains(github.event.comment.body, 'signed')
      ) 
      || (github.event.pull_request && !github.event.pull_request.merged)
    steps:
      - uses: Shopify/shopify-cla-action@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          cla-token: ${{ secrets.CLA_TOKEN }}

How it works / features

The check:

  • All PRs commit authors are checked against https://cla.shopify.com/
  • If all GitHub usernames signed the CLA, the check will pass
  • Otherwise the check will fail and the build message will ask first-time authors to sign the CLA

Comments:

  • Every comment is tested against regexp
  • If the test was successful, it will trigger re-run of previous failed check

Following comments will be ignored:

  • Comment on issue
  • Comment on merged PR
  • Comment without word signed will be filtered by a workflow definition

Reactions:

  • If comment is matched with regexp, action will add ๐Ÿ‘€ reaction to that comment
  • If comment has ๐Ÿ‘€ reaction and CLA check succeeded, action will also add ๐Ÿ‘ reaction
  • If comment has ๐Ÿ‘€ reaction and CLA check failed, action will also add ๐Ÿ‘Ž reaction

Caveats

This action does not produce any comments.

If you need additional interaction with your users, please use @actions/first-interaction.

Inputs

Name Required Default Description
github-token true $GITHUB_TOKEN The token to be used with GitHub interactions
cla-token true Provided by github-actions repository secret The token to access cla.shopify.com

Outputs

None

shopify-cla-action's People

Contributors

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