diff --git a/docs/docs/20-usage/20-pipeline-syntax.md b/docs/docs/20-usage/20-pipeline-syntax.md index 0f7f197a6..80585c36b 100644 --- a/docs/docs/20-usage/20-pipeline-syntax.md +++ b/docs/docs/20-usage/20-pipeline-syntax.md @@ -347,15 +347,15 @@ when: [Read more about cron](./45-cron.md) -#### `tag` +#### `ref` -This filter only applies to tag events. -Use glob expression to execute a step if the tag name starts with `v`: +The `ref` filter compares the git reference against which the pipeline is executed. +This allows you to filter, for example, tags that must start with **v**: ```yaml when: - - event: tag - tag: v* + event: tag + ref: refs/tags/v* ``` #### `status` @@ -834,7 +834,7 @@ when: The `ref` filter compares the git reference against which the pipeline is executed. This allows you to filter, for example, tags that must start with **v**: -```diff +```yaml when: event: tag ref: refs/tags/v* diff --git a/pipeline/schema/.woodpecker/test-when.yml b/pipeline/schema/.woodpecker/test-when.yml index 6b9d80af4..78f53e790 100644 --- a/pipeline/schema/.woodpecker/test-when.yml +++ b/pipeline/schema/.woodpecker/test-when.yml @@ -27,12 +27,12 @@ steps: when: event: [push, pull_request, tag, deployment] - when-tag: + when-ref: image: alpine commands: - echo "test" when: - tag: "v**" + ref: "refs/tags/v**" when-status: image: alpine diff --git a/pipeline/schema/schema.json b/pipeline/schema/schema.json index 289efc87d..199ee831a 100644 --- a/pipeline/schema/schema.json +++ b/pipeline/schema/schema.json @@ -139,8 +139,8 @@ } ] }, - "tag": { - "description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#tag", + "ref": { + "description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#ref", "type": "string" }, "cron": { @@ -289,8 +289,8 @@ } ] }, - "tag": { - "description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#tag", + "ref": { + "description": "Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax#ref", "type": "string" }, "cron": {