-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (100 loc) · 4.43 KB
/
comment-created.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0
name: '[Support] Comments based card movements'
on:
workflow_call:
secrets:
BITNAMI_SUPPORT_BOARD_TOKEN:
required: true
# Remove all permissions by default
permissions: {}
jobs:
comments_handler:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Repo checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 1
repository: bitnami/support
- name: Load .env file
uses: xom9ikk/dotenv@ac290ca23a42155a0cba1031d23afa46240116a9
- name: Add to board
id: add-to-project
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e
with:
# Support project
project-url: https://github.com/orgs/bitnami/projects/4
github-token: ${{ secrets.BITNAMI_SUPPORT_BOARD_TOKEN }}
- name: Move into From Build Maintenance
uses: EndBug/project-fields@6f7fc6da0386e32a70b25a766c6c01aef52c7d6b
# The comment was created by bitnami-bot in a pull_request created by bitnami-bot
if: ${{ github.actor == 'bitnami-bot' && github.event.issue.user.login == 'bitnami-bot' && github.event.issue.pull_request != null }}
with:
project_url: https://github.com/orgs/bitnami/projects/4
github_token: ${{ secrets.BITNAMI_SUPPORT_BOARD_TOKEN }}
operation: set
fields: Status
values: Build Maintenance
- name: Move into Pending
uses: EndBug/project-fields@6f7fc6da0386e32a70b25a766c6c01aef52c7d6b
if: |
(github.actor != 'bitnami-bot' || github.event.issue.user.login != 'bitnami-bot' || github.event.issue.pull_request == null) &&
contains(fromJson(env.BITNAMI_TEAM), github.actor) &&
(!contains(github.event.issue.labels.*.name, 'bitnami'))
with:
project_url: https://github.com/orgs/bitnami/projects/4
github_token: ${{ secrets.BITNAMI_SUPPORT_BOARD_TOKEN }}
operation: set
fields: Status
values: Pending
- name: Move into In progress
uses: EndBug/project-fields@6f7fc6da0386e32a70b25a766c6c01aef52c7d6b
if: |
(github.actor != 'bitnami-bot' || github.event.issue.user.login != 'bitnami-bot' || github.event.issue.pull_request == null) &&
(!contains(fromJson(env.BITNAMI_TEAM), github.actor)) &&
contains(github.event.issue.labels.*.name, 'in-progress')
with:
project_url: https://github.com/orgs/bitnami/projects/4
github_token: ${{ secrets.BITNAMI_SUPPORT_BOARD_TOKEN }}
operation: set
fields: Status
values: In progress
- name: Move into Triage
uses: EndBug/project-fields@6f7fc6da0386e32a70b25a766c6c01aef52c7d6b
if: |
(github.actor != 'bitnami-bot' || github.event.issue.user.login != 'bitnami-bot' || github.event.issue.pull_request == null) &&
(!contains(fromJson(env.BITNAMI_TEAM), github.actor)) &&
(!contains(github.event.issue.labels.*.name, 'in-progress')) &&
(!contains(github.event.issue.labels.*.name, 'bitnami'))
with:
project_url: https://github.com/orgs/bitnami/projects/4
github_token: ${{ secrets.BITNAMI_SUPPORT_BOARD_TOKEN }}
operation: set
fields: Status
values: Triage
labeling:
name: Set labels
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
steps:
- name: Get item info
id: get-item
run: |
# Note issue_comment event is slightly different than issues or pull_request. More info here: https://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment
author="${{ github.event.issue.user.login }}"
number="${{ github.event.issue.number }}"
type="${{ github.event.issue.pull_request != null && 'pull_request' || 'issue' }}"
echo "author=${author}" >> $GITHUB_OUTPUT
echo "number=${number}" >> $GITHUB_OUTPUT
echo "type=${type}" >> $GITHUB_OUTPUT
- name: Build Maintenance labeling
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
if: ${{ steps.get-item.outputs.type == 'pull_request' && steps.get-item.outputs.author == 'bitnami-bot' }}
with:
add-labels: review-required
remove-labels: auto-merge