Policyer Github Action

Search for a command to run...

No comments yet. Be the first to comment.
Introducing a new approach to cloud storage. Lyve™ Cloud from Seagate® is your simple, trusted and efficient storage as a service. Long-term cost predictability means you’ll never be surprised by your cloud bill. Put your data to work with always-on ...
Your team has 14 versions of the same code review skill across 5 repos, with no way to sync them. when one improves, the others don't. drop a folder in .claude/skills/ and pray nothing drifts. source

AI agents are unreasonably good at writing SQL. They get specific error messages, fix their own mistakes in one retry, and can introspect query performance with EXPLAIN ANALYZE before you even ask. No

n8n has over 400 integrations. Zapier claims 7,000+. Every single one was hand-built, tested against a moving API, and will eventually break when that API ships a v2. The entire workflow automation in

Part of the "Your Next Startup" series, where I break down startup ideas I think are worth building. Auth0 sold for \(6.5B. Okta is worth \)15B+. CyberArk, Delinea, BeyondTrust, all printing money fro

For as long as software has existed, we've been building two doors into our systems. Door one: the UI, a carefully designed surface where humans point, click, and occasionally rage-quit. Door two: the

My submission to the GitHub Actions x DEV Hackathon 2021!
Policyer is an open-source project (more like a vision) I created after being inspired by policy engines that become very popular lately (OPA,Checkov)
Policyer going to focus on providing a platform to run and create meaningful reports, data engagement and a plugin system to let you provide any data, sometimes it can be k8s YAML and in other cases, it can be user data.
The policyer-action lets you the option to run policyer as part of your CI process, in my example I'm going to validate GitHub SDK calls.
The provider is like a plugin for policyer engine, it provides the data so the engine can run it against the checks (polciies)
It's important for me to emphasise that Policyer provide a platform, and eventually I will want to see a marketplace full of people custom providers.
The action can use any provider either local or published to NPM (support for private registries is on the way). In my example, I created a simple provider to run GitHub SDK calls.
Example Check:
---
configuration:
provider: github-provider
type: rest
validEvents:
- pull_request
- push
domain: pulls
action: listRequestedReviewers
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-reviewers
name: check if reviewers exists.
severity: High
steps:
- path: data.users
condition: includes
value: "nirtester"
utility: map
utilityProps:
- "login"
(just a reminder this is a policy example and the GitHub action will evaluate it and output it as a report)
Check flow:
first of all we setup the configuration section where we can provide metadata for the check, in this example I'm asking the provider to do an SDK call:
SDK[pulls][listRequestedReviewers]({
owner: ...pull_request.base.user.login
repo: ...pull_request.base.repo.name
pull_number: ...pull_request.number
})
octokit docs
next, we going to dive into the actual policy, in this policy we want to verify a certain user is a reviewer, so after the call I'm going to point to the "users" array, then use the condition includes ([...users].includes(value)), utilities function by default includes all Lodash functions, you can add custom utilities in the provider level.
I'm going to use the map utility function to prepare an array of reviewers' usernames.
the final step is the results:
Wacky Wildcards
# 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
Visit Policyer for more information this is just the beginning
chalk
figlet
jmespath
lodash
moment
yaml
yargs
@actions/core/github