Skip to content

Commit

Permalink
Backport maintenance_bot from dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Mar 11, 2021
1 parent d2afd63 commit 1ee6182
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/maintenance_bot.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Maintenance Bot"
name: Maintenance Bot
on:
pull_request_target:
types: [opened, reopened]
types: [opened, reopened, edited, ready_for_review, unlabeled]

jobs:
labeler:
Expand All @@ -10,8 +10,21 @@ jobs:
env:
MILESTONE_NUMBER: 19
steps:
- name: Get latest pull request labels
id: get_pr_labels
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const response = await github.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
console.log(response);
return response.data;
- name: Add area labels
if: ${{ ! contains(join(github.event.pull_request.labels.*.name, ', '), 'area/') }}
if: ${{ ! contains(join(fromJSON(steps.get_pr_labels.outputs.result).*.name, ', '), 'area/') }}
uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down

0 comments on commit 1ee6182

Please sign in to comment.