Don't fail if label is not there
&& !contains(github.event.issue.labels.*.name, 'review-requested')
runs-on: ubuntu-latest
steps:
- - name: add-labels
+ - name: check-teams
uses: actions/github-script@v6
with:
+ result-encoding: json
script: |
const teams = [
'@conda-forge/staged-recipes',
let text = context.payload.comment.body;
const regex = new RegExp(team + '[^\-]|' + team + '$');
let result = regex.test(text);
+ let found_label = false;
if (result) {
label = team.replace("@conda-forge/help-", "");
label_no_staged = label.replace("@conda-forge/", "");
+ let found_label = true;
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [label_no_staged, 'review-requested']
- })
+ });
+ // TODO: Maybe use GitHub API to request review / assign team
+ }
+ };
+ return found_label
+ - name: add-labels
+ if: >
+ steps.set-result.outputs.result
+ && contains(github.event.issue.labels.*.name, 'Awaiting author contribution')
+ uses: actions/github-script@v6
+ with:
+ script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ['Awaiting author contribution']
- });
- // TODO: Maybe use GitHub API to request review / assign team
- }
- }
+ })
+
remove-review-requested-label:
name: 'When reviewed, remove review-requested label'
