-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (58 loc) · 2.54 KB
/
item-closed.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0
name: '[Support] Move closed issues'
on:
workflow_call:
secrets:
BITNAMI_SUPPORT_BOARD_TOKEN:
required: true
# Remove all permissions by default. Actions are performed by Bitnami Bot
permissions: {}
jobs:
send_to_solved:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Get item info
id: get-item
run: |
author="${{ github.event.issue != null && github.event.issue.user.login || github.event.pull_request.user.login }}"
number="${{ github.event.issue != null && github.event.issue.number || github.event.pull_request.number }}"
type="${{ github.event.issue != null && 'issue' || 'pull_request' }}"
echo "author=${author}" >> $GITHUB_OUTPUT
echo "number=${number}" >> $GITHUB_OUTPUT
echo "type=${type}" >> $GITHUB_OUTPUT
- name: Solved labeling
# Only if moved into Solved and the issue author is not bitnami-bot
if: ${{ steps.get-item.outputs.author != 'bitnami-bot' }}
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
with:
add-labels: solved
# Triage is not on the list to know how many issues/PRs are solved
# directly on triage
remove-labels: in-progress, on-hold
- name: Add to board
id: add-to-project
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e
if: |
steps.get-item.outputs.author != 'bitnami-bot' ||
(steps.get-item.outputs.author == 'bitnami-bot' && contains(github.event.pull_request.labels.*.name, 'review-required'))
with:
# Support project
project-url: https://github.com/orgs/bitnami/projects/4
github-token: ${{ secrets.BITNAMI_SUPPORT_BOARD_TOKEN }}
- name: Send to the Solved column
id: send-solved
uses: EndBug/project-fields@6f7fc6da0386e32a70b25a766c6c01aef52c7d6b
# Send to solve only the issues and PRs created by users or the automated PRs with human review required
if: |
steps.get-item.outputs.author != 'bitnami-bot' ||
(steps.get-item.outputs.author == 'bitnami-bot' && (!contains(github.event.pull_request.labels.*.name, 'auto-merge')))
with:
project_url: https://github.com/orgs/bitnami/projects/4
github_token: ${{ secrets.BITNAMI_SUPPORT_BOARD_TOKEN }}
operation: set
fields: Status
values: Solved