Auto assign pull requests to 'Priority 2' column (#6615)

* Auto assign pull requests to 'Priority 2' column

* Update 'pr-linked-issues-action' to v2
This commit is contained in:
Álvaro Mondéjar 2021-09-29 01:03:14 +02:00 committed by GitHub
parent 9292184b91
commit 3056f5e287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,23 +17,52 @@ jobs:
needs: triage needs: triage
env: env:
MY_GITHUB_TOKEN: ${{ secrets.AUTO_ASSIGN_WORKFLOW_TOKEN }} MY_GITHUB_TOKEN: ${{ secrets.AUTO_ASSIGN_WORKFLOW_TOKEN }}
steps:
steps: steps:
- id: get-labels - id: get-labels
name: Get labels name: Get labels
run: | run: |
labels="$(curl --retry 5 -s https://api.github.com/repos/simple-icons/simple-icons/pulls/${{ github.event.pull_request.number }} | jq '.labels[].name' | tr '\n' ',' | sed 's/"//g' | sed 's/,$//')" labels="$(curl --retry 5 -s https://api.github.com/repos/simple-icons/simple-icons/pulls/${{ github.event.pull_request.number }} | jq '.labels[].name' | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
echo "::set-output name=labels::$labels" echo "::set-output name=labels::$labels"
- name: Assign pull requests to "Unprioritised" - id: get-si-members
uses: srggrs/assign-one-project-github-action@1.2.1 name: Get simple-icons members
if: contains(steps.get-labels.outputs.labels, 'icon outdated') == false run: |
with: members="$(curl --retry 5 -s https://api.github.com/orgs/simple-icons/members | jq .[].login | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
project: https://github.com/orgs/simple-icons/projects/2 echo "::set-output name=members::$members"
column_name: Unprioritised
- name: Assign `icon outdated` pull requests to "Priority 1" - id: get-linked-issues
name: Get linked issue numbers
uses: mondeja/pr-linked-issues-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: priority-1
name: Assign `icon outdated` pull requests to "Priority 1"
uses: srggrs/assign-one-project-github-action@1.2.1 uses: srggrs/assign-one-project-github-action@1.2.1
if: contains(steps.get-labels.outputs.labels, 'icon outdated') if: contains(steps.get-labels.outputs.labels, 'icon outdated')
with: with:
project: https://github.com/orgs/simple-icons/projects/2 project: https://github.com/orgs/simple-icons/projects/2
column_name: Priority 1 column_name: Priority 1
- id: priority-2
name: Assign `new icon` pull requests to "Priority 2"
uses: srggrs/assign-one-project-github-action@1.2.1
# the PR has the `new icon` label along with a linked issue and
# the opener is not a member of simple-icons organization
if: |
contains(steps.get-labels.outputs.labels, 'new icon') &&
join(steps.get-linked-issues.outputs.issues) != '' &&
contains(steps.get-si-members.outputs.members, github.event.actor.login) == false
with:
project: https://github.com/orgs/simple-icons/projects/2
column_name: Priority 2
- name: Assign pull requests to "Unprioritised"
uses: srggrs/assign-one-project-github-action@1.2.1
if: |
steps.priority-1.conclusion == 'skipped' &&
steps.priority-2.conclusion == 'skipped'
with:
project: https://github.com/orgs/simple-icons/projects/2
column_name: Unprioritised