Skip to content

niradler/policyer-github

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

policyer-github

Github provider to test and validate github sdk calls.

visit policyer repository

Getting Started

# Create checks/validate_branch.yml file
configuration:
  provider: github-provider
  type: github
checks:
  - id: validate-branch-name
    name: check if branch start with Fix-.
    severity: High
    steps:
      - path: env.GITHUB_HEAD_REF
        condition: equal
        value: true
        utility: regex
        utilityProps:
          - "/^FIX-/"
# Create checks/validate_pr_title.yml file
configuration:
  provider: github-provider
  type: rest
  validEvents:
    - pull_request
  domain: pulls
  action: get
  args:
    owner: context.payload.pull_request.base.user.login
    repo: context.payload.pull_request.base.repo.name
    pull_number: context.payload.pull_request.number
checks:
  - id: validate-pr-title
    name: check if pr title start with FIX.
    severity: High
    steps:
      - path: data.title
        condition: equal
        value: true
        utility: regex
        utilityProps:
          - "/^FIX/i"

and add github action:

# Add github action file .github/workflows/policyer.yml
name: Policyer

on: [pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Policyer GitHub Action
        uses: policyerorg/policyer-action@v0.0.3-alpha
        with:
          verbose: false
          provider: policyer-github
          internal: false
          checks_path: ./checks

Workflow

Links for github documentation:

Releases

No releases published

Packages

No packages published