mirror of
https://github.com/bitnami/containers.git
synced 2026-10-17 21:13:11 +02:00
[bitnami/*] Parametrizing teams for the support workflows (#769)
* Automated PRs created by the bitnami-bot should be ignored by any workflow related to support activities. Signed-off-by: Alejandro Gómez <morona@vmware.com> * Parametrizing triage and support teams. Automating BITNAMI_TEAM on .env file (daily). Using the BITNAMI_BOT_TOKEN instead of the PAT one Signed-off-by: Alejandro Gómez <morona@vmware.com> * Parametrizing triage and support teams. Automating BITNAMI_TEAM on .env file (daily). Using the BITNAMI_BOT_TOKEN instead of the PAT one Signed-off-by: Alejandro Gómez <morona@vmware.com> * Adding the proper user.name and user.email to the git commands Signed-off-by: Alejandro Gómez <morona@vmware.com> * Adding suggestions from fmulero Signed-off-by: Alejandro Gómez <morona@vmware.com> * Adding suggestions from fmulero Signed-off-by: Alejandro Gómez <morona@vmware.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
BITNAMI_TEAM='["bitnami-bot","jotamartos","alemorcuq","agomezmoron","carrodher","corico44","dgomezleon","fmulero","FraPazGal","javsalgar","gongomgra","joancafom","marcosbc","aoterolorenzo","CeliaGMqrz","Mauraza","mdhont","migruiz4","rafariossaa","beltran-rubo","recena"]'
|
||||
SUPPORT_TEAM='["alemorcuq","carrodher","fmulero","FraPazGal","javsalgar","joancafom","marcosbc","migruiz4","rafariossaa"]'
|
||||
TRIAGE_TEAM='["carrodher","fmulero", "javsalgar","rafariossaa"]'
|
||||
IN_PROGRESS_COLUMN_ID=19026822
|
||||
TRIAGE_COLUMN_ID=19026814
|
||||
SOLVED_COLUMN_ID=19026825
|
||||
ON_HOLD_COLUMN_ID=19026824
|
||||
BITNAMI_COLUMN_ID=19026814
|
||||
PENDING_COLUMN_ID=19026823
|
||||
SUPPORT_TEAM_NAME='containers-support'
|
||||
TRIAGE_TEAM_NAME='containers-triage'
|
||||
@@ -29,25 +29,18 @@ jobs:
|
||||
uses: xom9ikk/dotenv@v1.0.2
|
||||
with:
|
||||
path: .github/workflows/
|
||||
- name: Preparing string variables
|
||||
run: |
|
||||
TRIAGE_TEAM_STRING=${TRIAGE_TEAM/[/}
|
||||
TRIAGE_TEAM_STRING=${TRIAGE_TEAM_STRING/]/}
|
||||
TRIAGE_TEAM_STRING=${TRIAGE_TEAM_STRING//'"'/}
|
||||
# creating env variable "on the fly"
|
||||
echo "TRIAGE_TEAM_STRING=$TRIAGE_TEAM_STRING" >> $GITHUB_ENV
|
||||
- name: Send to the Solved column
|
||||
uses: peter-evans/create-or-update-project-card@v2
|
||||
with:
|
||||
project-name: Support
|
||||
# If the author comes from Bitnami, send it to Bitnami. Otherwise, all to Triage
|
||||
column-name: 'Solved'
|
||||
token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
issue-number: ${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }}
|
||||
- name: Solved labeling
|
||||
# Only if moved into Solved
|
||||
uses: andymckay/labeler@1.0.4
|
||||
with:
|
||||
repo-token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
repo-token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
add-labels: "solved"
|
||||
remove-labels: "in-progress, on-hold, triage"
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
if: ${{ github.event.project_card.column_id == env.ON_HOLD_COLUMN_ID }}
|
||||
uses: andymckay/labeler@1.0.4
|
||||
with:
|
||||
repo-token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
repo-token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
add-labels: "on-hold"
|
||||
remove-labels: "triage"
|
||||
- name: In progress labeling
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
if: ${{ github.event.project_card.column_id == env.IN_PROGRESS_COLUMN_ID }}
|
||||
uses: andymckay/labeler@1.0.4
|
||||
with:
|
||||
repo-token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
repo-token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
add-labels: "in-progress"
|
||||
remove-labels: "on-hold, triage"
|
||||
- name: Solved labeling
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
if: ${{ github.event.project_card.column_id == env.SOLVED_COLUMN_ID }}
|
||||
uses: andymckay/labeler@1.0.4
|
||||
with:
|
||||
repo-token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
repo-token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
add-labels: "solved"
|
||||
remove-labels: "in-progress, on-hold, triage"
|
||||
assign-assignee-if-needed:
|
||||
@@ -64,20 +64,12 @@ jobs:
|
||||
uses: xom9ikk/dotenv@v1.0.2
|
||||
with:
|
||||
path: .github/workflows/
|
||||
- name: Preparing string variables
|
||||
run: |
|
||||
SUPPORT_TEAM_STRING=${SUPPORT_TEAM/[/}
|
||||
SUPPORT_TEAM_STRING=${SUPPORT_TEAM_STRING/]/}
|
||||
SUPPORT_TEAM_STRING=${SUPPORT_TEAM_STRING//'"'/}
|
||||
# creating env variable "on the fly"
|
||||
echo "SUPPORT_TEAM_STRING=$SUPPORT_TEAM_STRING" >> $GITHUB_ENV
|
||||
- name: Assign to a person to work on it
|
||||
# Only if moved into In progress FROM Triage
|
||||
if: ${{ github.event.project_card.column_id == env.IN_PROGRESS_COLUMN_ID && github.event.changes != null && github.event.changes.column_id && github.event.changes.column_id.from == env.TRIAGE_COLUMN_ID }}
|
||||
uses: pozil/auto-assign-issue@v1.7.3
|
||||
with:
|
||||
numOfAssignee: 1
|
||||
assignees: ${{ env.SUPPORT_TEAM_STRING }}
|
||||
removePreviousAssignees: true
|
||||
# teams: XXX
|
||||
repo-token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
teams: ${{ env.SUPPORT_TEAM_NAME }}
|
||||
repo-token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
@@ -0,0 +1,39 @@
|
||||
name: '[Support] Synchronize team members in the .env file'
|
||||
on:
|
||||
schedule:
|
||||
# Daily
|
||||
- cron: '0 1 * * *'
|
||||
permissions:
|
||||
repository-projects: write
|
||||
|
||||
jobs:
|
||||
sync-support-teams:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Repo checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.BITNAMI_BOT_TOKEN }}
|
||||
fetch-depth: 1
|
||||
- name: Load .env file
|
||||
uses: xom9ikk/dotenv@v1.0.2
|
||||
with:
|
||||
path: .github/workflows/
|
||||
- name: Updating members of the Bitnami team
|
||||
run: |
|
||||
TEAM_MEMBERS=$(curl --request GET \
|
||||
--url https://api.github.com/orgs/bitnami/teams/developers/members \
|
||||
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
|
||||
--header 'content-type: application/json' \
|
||||
| jq 'sort_by(.login)|map(.login)|join(",")')
|
||||
TEAM_MEMBERS='['${TEAM_MEMBERS//','/'","'}']'
|
||||
if [ $TEAM_MEMBERS != $BITNAMI_TEAM ]; then
|
||||
echo "Replacing $BITNAMI_TEAM for $TEAM_MEMBERS"
|
||||
sed -i "s|BITNAMI_TEAM=.*$|BITNAMI_TEAM='${TEAM_MEMBERS}'|g" .github/workflows/.env
|
||||
git config user.name "bitnami-bot"
|
||||
git config user.email "bitnami-bot@vmware.com"
|
||||
git commit -s -m"[bitnami-bot] Updating Bitnami team members" .github/workflows/.env
|
||||
git push
|
||||
else
|
||||
echo "BITNAMI_TEAM is updated and nothing should be done"
|
||||
fi
|
||||
@@ -32,34 +32,26 @@ jobs:
|
||||
uses: xom9ikk/dotenv@v1.0.2
|
||||
with:
|
||||
path: .github/workflows/
|
||||
- name: Preparing string variables
|
||||
run: |
|
||||
TRIAGE_TEAM_STRING=${TRIAGE_TEAM/[/}
|
||||
TRIAGE_TEAM_STRING=${TRIAGE_TEAM_STRING/]/}
|
||||
TRIAGE_TEAM_STRING=${TRIAGE_TEAM_STRING//'"'/}
|
||||
# creating env variable "on the fly"
|
||||
echo "TRIAGE_TEAM_STRING=$TRIAGE_TEAM_STRING" >> $GITHUB_ENV
|
||||
- name: Assign to a person to work on it
|
||||
uses: pozil/auto-assign-issue@v1.7.3
|
||||
with:
|
||||
numOfAssignee: 1
|
||||
assignees: ${{ env.TRIAGE_TEAM_STRING }}
|
||||
removePreviousAssignees: false
|
||||
# teams: XXX
|
||||
repo-token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
teams: ${{ env.TRIAGE_TEAM_NAME }}
|
||||
repo-token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
- name: Send to the board
|
||||
uses: peter-evans/create-or-update-project-card@v2
|
||||
with:
|
||||
project-name: Support
|
||||
# If the author comes from Bitnami, send it to Bitnami. Otherwise, all to Triage
|
||||
column-name: ${{ (contains(fromJson(env.BITNAMI_TEAM), github.actor)) && 'From Bitnami' || 'Triage' }}
|
||||
token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
issue-number: ${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }}
|
||||
- name: Triage labeling
|
||||
# Only if moved into Solved
|
||||
uses: andymckay/labeler@1.0.4
|
||||
with:
|
||||
repo-token: "${{ secrets.GHPROJECT_TOKEN }}"
|
||||
repo-token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||||
add-labels: ${{ (!contains(fromJson(env.BITNAMI_TEAM), github.actor)) && 'triage' || 'bitnami' }}
|
||||
# For reopened issues
|
||||
remove-labels: "solved"
|
||||
Reference in New Issue
Block a user