Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Add branch and tag filter
Browse files Browse the repository at this point in the history
[changelog:added]
  • Loading branch information
cdupuis committed Dec 7, 2020
1 parent 7858a5b commit 37ab766
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ Connect and configure these integrations:
[semantic version][semver], the `latest` tag is added, making the published
version the new default.

1. **Specify optional branch or tag filters**

Specify one or more regular expressions to match against the branch or tag
name of the skill trigger.

To limit this skill to only run on _feature_ branches, you could use the
`feature\/.*` regular expression as filter.

1. **Specify an optional bash command**

![Shell command](docs/images/shell-command.png)
Expand All @@ -81,7 +89,7 @@ Connect and configure these integrations:
20.04 LTS container. This command is after the code is checked out but
before Node.js is setup or any npm commands are run.

Here's is an example on how to install MongoDB and start it:
Here is an example on how to install MongoDB and start it:

```bash
apt-get update \
Expand Down
6 changes: 5 additions & 1 deletion skill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import { Configuration } from "./lib/configuration";

export const Skill = skill<
Configuration & { repos: any; subscription_filter: any }
Configuration & { repos: any; subscription_filter: any; ref_filter: any }
>({
description: "Run npm scripts to compile or test your JavaScript project",
displayName: "npm Build",
Expand Down Expand Up @@ -118,6 +118,10 @@ export const Skill = skill<
"Register the published package with the given tags. If no tag is set here, the package will get published with a branch specific tag, e.g. `branch-<name of branch>`.",
required: false,
},
ref_filter: {
...parameter.refFilter(),
visibility: ParameterVisibility.Advanced,
},
command: {
type: ParameterType.String,
displayName: "Shell command",
Expand Down

0 comments on commit 37ab766

Please sign in to comment.