[bitnami/containers] Remove unnecessary workflows (#53315)

Signed-off-by: Fran Mulero <fmulero@vmware.com>
This commit is contained in:
Fran Mulero
2023-12-02 10:19:51 +01:00
committed by GitHub
parent abf52b8ca7
commit e0d89a9a72
4 changed files with 0 additions and 248 deletions

View File

@@ -1,9 +0,0 @@
BITNAMI_TEAM='["Akinorev","CeliaGMqrz","ClaaudiaGarcia","FlorinTataru","FraPazGal","Javirln","Mauraza","agarcia-oss","alemorcuq","alexherp","alvneiayu","andresbono","antgamdia","aoterolorenzo","beltran-rubo","bitnami-bot","carlossm","carrodher","castelblanque","corico44","cscazorla","dani8art","dariver","dcristobalhMad","dgomezleon","fevisera","fjagugar","fmulero","gdelgadot","gfichtenholt","gongomgra","javsalgar","jbianquetti-nami","jiparis","joancafom","jotadrilo","jotamartos","juamedgod","juan131","kaysavps","mdhont","migruiz4","mpermar","pablogalegoc","ppbaena","rafariossaa","rloporp","rogelio-o","tompizmor","xoanteis","zubero"]'
IN_PROGRESS_COLUMN_ID=19026822
TRIAGE_COLUMN_ID=19026814
SOLVED_COLUMN_ID=19026825
ON_HOLD_COLUMN_ID=19026824
BITNAMI_COLUMN_ID=19026818
PENDING_COLUMN_ID=19026823
SUPPORT_TEAM_NAME='containers-support'
TRIAGE_TEAM_NAME='containers-triage'

View File

@@ -1,46 +0,0 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
name: '[Support] Delete Solved cards'
on:
workflow_dispatch:
schedule:
# Every 2 hours
- cron: '15 0/2 * * *'
# Remove all permissions by default
permissions: {}
jobs:
delete-cards:
runs-on: ubuntu-latest
permissions:
repository-projects: write
contents: read
steps:
- name: Repo checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 1
- name: Load .env file
uses: xom9ikk/dotenv@de1ff27d319507880e6621e4d47424c677d95f68
with:
path: .github/workflows/
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
script: |
const {SOLVED_COLUMN_ID} = process.env
const {data: cards} = await github.rest.projects.listCards({
column_id: `${SOLVED_COLUMN_ID}`,
archived_state: 'all',
per_page: 100
});
// Remove cards without updates in last week.
const comparedDate = new Date();
comparedDate.setDate(comparedDate.getDate() - 7);
cards.forEach(card => {
const lastUpdate = new Date(card.updated_at);
if (card.archived || lastUpdate < comparedDate ) {
github.rest.projects.deleteCard({
card_id: card.id
});
}
});

View File

@@ -1,149 +0,0 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
# This workflow is built to manage the triage support by using GH issues.
name: '[Support] Cards movements'
on:
project_card:
types:
- created
- moved
# Remove all permissions by default
permissions: {}
jobs:
get-issue:
runs-on: ubuntu-latest
name: Get issue info
permissions:
issues: read
pull-requests: read
outputs:
assignees: ${{ steps.get-issue-step.outputs.assignees }}
author: ${{ steps.get-issue-step.outputs.author }}
type: ${{ steps.get-issue-step.outputs.type }}
draft: ${{ steps.get-issue-step.outputs.draft }}
number: ${{ steps.get-issue-step.outputs.number }}
steps:
- name: Get issue info
id: get-issue-step
run: |
issue_info=$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "${{ github.event.project_card.content_url }}" )
assignees="$(echo $issue_info | jq -cr '.assignees')"
author="$(echo $issue_info | jq -r '.user.login')"
pull_request="$(echo $issue_info | jq -r '.pull_request')"
draft="$(echo $issue_info | jq -r '.draft' | sed -r "s|null|false|g")"
number="$(echo $issue_info | jq -r '.number')"
type="pull_request"
if [[ "${pull_request}" == "null" ]]; then
type="issue"
fi
echo "assignees=${assignees}" >> $GITHUB_OUTPUT
echo "author=${author}" >> $GITHUB_OUTPUT
echo "type=${type}" >> $GITHUB_OUTPUT
echo "draft=${draft}" >> $GITHUB_OUTPUT
echo "number=${number}" >> $GITHUB_OUTPUT
label-card:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
needs:
- get-issue
steps:
- name: Repo checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 1
- name: Load .env file
uses: xom9ikk/dotenv@de1ff27d319507880e6621e4d47424c677d95f68
with:
path: .github/workflows/
# Now handling the needed labeling
- name: Triage labeling
# Only if moved into triage
if: ${{ github.event.project_card.column_id == env.TRIAGE_COLUMN_ID }}
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
with:
add-labels: triage
remove-labels: on-hold, in-progress, solved
- name: From Bitnami labeling
if: ${{ github.event.project_card.column_id == env.BITNAMI_COLUMN_ID }}
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
with:
add-labels: ${{ (needs.get-issue.outputs.author == 'bitnami-bot' && needs.get-issue.outputs.type == 'pull_request') && 'automated, auto-merge' || 'bitnami' }}
remove-labels: on-hold, in-progress, triage, solved
- name: Verify labeling
# Only if moved into bitnami column and the PR is ready for review
# Consecutive calls were fixed in fmulero/labeler, see https://github.com/fmulero/labeler/pull/2
if: |
github.event.project_card.column_id == env.BITNAMI_COLUMN_ID &&
needs.get-issue.outputs.type == 'pull_request' && needs.get-issue.outputs.draft == 'false'
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
with:
repo-token: ${{ secrets.BITNAMI_BOT_TOKEN }}
add-labels: verify
- name: On hold labeling
# Only if moved into on hold
if: ${{ github.event.project_card.column_id == env.ON_HOLD_COLUMN_ID }}
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
with:
add-labels: on-hold
remove-labels: triage, in-progress, solved
- name: In progress labeling
# Only if moved into In progress
if: ${{ github.event.project_card.column_id == env.IN_PROGRESS_COLUMN_ID }}
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
with:
add-labels: in-progress
remove-labels: on-hold, triage, solved
- name: Solved labeling
# Only if moved into Solved and the issue author is not bitnami-bot
if: |
github.event.project_card.column_id == env.SOLVED_COLUMN_ID &&
(needs.get-issue.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
assign-assignee-if-needed:
runs-on: ubuntu-latest
permissions:
contents: read
needs:
- get-issue
# The job shouldn't run for solved cards
steps:
- name: Repo checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 1
- name: Load .env file
uses: xom9ikk/dotenv@de1ff27d319507880e6621e4d47424c677d95f68
with:
path: .github/workflows/
- name: Assign to a person to work on it
# Assign when there is nobody assigned or the card is new.
if: |
github.event.project_card.column_id != env.SOLVED_COLUMN_ID && (needs.get-issue.outputs.assignees == '[]' || github.event.action == 'created')
uses: pozil/auto-assign-issue@edee9537367a8fbc625d27f9e10aa8bad47b8723
with:
numOfAssignee: 1
teams: ${{ github.event.project_card.column_id == env.BITNAMI_COLUMN_ID && env.SUPPORT_TEAM_NAME || env.TRIAGE_TEAM_NAME }}
repo-token: ${{ secrets.BITNAMI_BOT_TOKEN }}
allowSelfAssign: false
- name: Reassign when moved into 'In progress' from 'Triage'
# Reassigned when moved into In progress FROM Triage
if: |
github.event.action == 'moved' && needs.get-issue.outputs.assignees != '[]' &&
github.event.project_card.column_id == env.IN_PROGRESS_COLUMN_ID &&
github.event.changes.column_id.from == env.TRIAGE_COLUMN_ID
uses: pozil/auto-assign-issue@edee9537367a8fbc625d27f9e10aa8bad47b8723
with:
numOfAssignee: 1
removePreviousAssignees: true
teams: ${{ env.SUPPORT_TEAM_NAME }}
repo-token: ${{ secrets.BITNAMI_BOT_TOKEN }}
allowSelfAssign: false

View File

@@ -1,44 +0,0 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
name: '[Support] Synchronize team members in the .env file'
on:
workflow_dispatch:
schedule:
# Daily
- cron: '0 5 * * *'
# Remove all permissions by default. Write actions are done by Bitnami Bot
permissions: {}
jobs:
sync-support-teams:
runs-on: ubuntu-latest
steps:
- name: Repo checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
token: ${{ secrets.BITNAMI_BOT_TOKEN }}
fetch-depth: 1
- name: Load .env file
uses: xom9ikk/dotenv@de1ff27d319507880e6621e4d47424c677d95f68
with:
path: .github/workflows/
- name: Updating members of the Bitnami team
env:
TOKEN: ${{ secrets.BITNAMI_BOT_TOKEN }}
run: |
TEAM_MEMBERS=$(curl --request GET \
--url https://api.github.com/orgs/bitnami/teams/developers/members?per_page=100 \
--header "authorization: Bearer ${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