Skip to content

Commit

Permalink
chore(templates): add docs for rulesets for templates (go-vela#358)
Browse files Browse the repository at this point in the history
Co-authored-by: David May <49894298+wass3rw3rk@users.noreply.github.com>
  • Loading branch information
ecrupper and wass3rw3rk authored Apr 25, 2023
1 parent d89ba33 commit 05ecc1a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions content/templates/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,33 @@ steps:
image: golang:latest
```

### Rulesets for Templates

As of `v0.19.0`, users can leverage step [`rulesets`](/docs/tour/rulesets) for steps that call a template:

```yaml
version: "1"
templates:
- name: pr_flow
source: pr_flow.yml
type: file
steps:
- name: always run
image: alpine:latest
commands:
- echo "always run"
- name: pr template
ruleset:
event: pull_request
template:
name: pr_flow
```

**NOTE:** Only compile-time rules are supported for template rulesets. Runtime rules, such as `status`, will not work, as the template has already been merged into the parent pipeline at that time. Any rulesets within the template will still be valid provided the template itself passes the ruleset.

### Templating directly in `.vela.yml`

As of `0.9.0` Vela allows using Starlark and Go templates directly in the `.vela.yml`
Expand Down

0 comments on commit 05ecc1a

Please sign in to comment.