Edit readme and run build

This commit is contained in:
anthonylaye
2022-06-16 18:18:27 +02:00
parent 0f1ba59d26
commit d0b7876408
3 changed files with 10 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ _See [action.yml](action.yml) for [metadata](https://docs.github.com/en/actions/
_For more information about workflows, see [Using workflows](https://docs.github.com/en/actions/using-workflows)._
Create a workflow that runs when Issues or Pull Requests are opened or labeled in your repository; this workflow also supports adding Issues to your project which are transferred into your repository. Optionally configure any filters you may want to add, such as only adding issues with certain labels, you may match labels with an `AND` or an `OR` operator.
Create a workflow that runs when Issues or Pull Requests are opened or labeled in your repository; this workflow also supports adding Issues to your project which are transferred into your repository. Optionally configure any filters you may want to add, such as only adding issues with certain labels. You may match labels with an `AND` or an `OR` operator, or exclude labels with a `NOT` operator.
Once you've configured your workflow, save it as a `.yml` file in your target Repository's `.github/workflows` directory.
@@ -87,7 +87,7 @@ jobs:
`read:org` scopes.
_See [Creating a PAT and adding it to your repository](#creating-a-pat-and-adding-it-to-your-repository) for more details_
- <a name="labeled">`labeled`</a> **(optional)** is a comma-separated list of labels used to filter applicable issues. When this key is provided, an issue must have _one_ of the labels in the list to be added to the project. Omitting this key means that any issue will be added.
- <a name="labeled">`label-operator`</a> **(optional)** is the behavior of the labels filter, either `AND` or `OR` that controls if the issue should be matched with `all` `labeled` input or any of them, default is `OR`.
- <a name="labeled">`label-operator`</a> **(optional)** is the behavior of the labels filter, either `AND`, `OR` or `NOT` that controls if the issue should be matched with `all` `labeled` input or any of them, default is `OR`.
## Supported Events

8
dist/index.js generated vendored
View File

@@ -67,12 +67,18 @@ function addToProject() {
return;
}
}
else {
else if (labelOperator === 'or') {
if (labeled.length > 0 && !issueLabels.some(l => labeled.includes(l))) {
core.info(`Skipping issue ${issue === null || issue === void 0 ? void 0 : issue.number} because it does not have one of the labels: ${labeled.join(', ')}`);
return;
}
}
else if (labelOperator === 'not') {
if (labeled.length > 0 && issueLabels.some(l => labeled.includes(l))) {
core.info(`Skipping issue ${issue === null || issue === void 0 ? void 0 : issue.number} because it contains one of the labels: ${labeled.join(', ')}`);
return;
}
}
core.debug(`Project URL: ${projectUrl}`);
if (!urlMatch) {
throw new Error(`Invalid project URL: ${projectUrl}. Project URL should match the format https://github.com/<orgs-or-users>/<ownerName>/projects/<projectNumber>`);

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long