Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/pull-request-policy.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
policies:
github-changes-need-approval:
when:
changed: '.github/**'
require:
approvals: 1

conventional-title:
require:
title: '^(feat|fix|docs|refactor|test|chore|build|ci|perf|revert)(\([^)]+\))?!?: .+'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/self-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: self-test

on:
pull_request:
types: [opened, synchronize, reopened, edited]

permissions: {}

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ For the fastest first run, keep the workflow and policy together:

```yaml
name: PR Policy
on: [pull_request]
on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
policy:
Expand Down
8 changes: 6 additions & 2 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ The inline `policy` input keeps this first experiment to one file:

```yaml
name: PR Policy
on: [pull_request]
on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
policy:
Expand Down Expand Up @@ -69,7 +71,9 @@ repository controls that make the result a merge gate.

```yaml
name: PR Policy
on: [pull_request]
on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
policy:
Expand Down
4 changes: 3 additions & 1 deletion src/generator/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ function appendLine(lines: string[], level: number, value: string): void {
export function generateWorkflowYaml(options: WorkflowOptions): string {
const lines: string[] = [];
appendLine(lines, 0, 'name: PR Policy');
appendLine(lines, 0, 'on: [pull_request]');
appendLine(lines, 0, 'on:');
appendLine(lines, 1, 'pull_request:');
appendLine(lines, 2, 'types: [opened, synchronize, reopened, edited]');
appendLine(lines, 0, 'jobs:');
appendLine(lines, 1, 'policy:');
appendLine(lines, 2, 'runs-on: ubuntu-latest');
Expand Down
2 changes: 1 addition & 1 deletion test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5
8
4 changes: 3 additions & 1 deletion tests/unit/generator-quick-start.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ describe('quick start generator', () => {
const yaml = generateWorkflowYaml(createDefaultGeneratorState().workflow);

expect(yaml).toBe(`name: PR Policy
on: [pull_request]
on:
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
policy:
runs-on: ubuntu-latest
Expand Down
Loading