Skip to content

Commit

Permalink
🔄 synced local '.github/workflows/' with remote 'workflows/' (#1249)
Browse files Browse the repository at this point in the history
Signed-off-by: bitnami-bot <[email protected]>
  • Loading branch information
bitnami-bot authored Nov 23, 2023
1 parent 3f827d6 commit f7d34a4
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 134 deletions.
62 changes: 6 additions & 56 deletions .github/workflows/comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,10 @@ on:
types:
- created
# Remove all permissions by default
permissions: {}
# Avoid concurrency over the same issue
concurrency:
group: card-movement-${{ github.event.issue.number }}
permissions:
pull-requests: write
issues: write
jobs:
comments_handler:
runs-on: ubuntu-latest
permissions:
contents: read
repository-projects: write
issues: read
pull-requests: read
steps:
- name: Repo checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Load .env file
uses: xom9ikk/dotenv@de1ff27d319507880e6621e4d47424c677d95f68
with:
path: .github/workflows/
- name: Move into From Build Maintenance
uses: peter-evans/create-or-update-project-card@dfa240db6fe287ceb681e45d6728c1af70452c58
# 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-name: Support
column-name: Build Maintenance
# Required to trigger moving-cards.yml workflow (clean labels and assign people to work on it)
token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
- name: Move into Pending
uses: peter-evans/create-or-update-project-card@dfa240db6fe287ceb681e45d6728c1af70452c58
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-name: Support
column-name: Pending
- name: Move into In Progress
uses: peter-evans/create-or-update-project-card@dfa240db6fe287ceb681e45d6728c1af70452c58
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-name: Support
column-name: In progress
- name: Move into Triage
uses: peter-evans/create-or-update-project-card@dfa240db6fe287ceb681e45d6728c1af70452c58
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-name: Support
column-name: Triage
# Needs reasignation of the task
token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
call-comments-workflow:
uses: bitnami/support/.github/workflows/comment-created.yml@main
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

name: '[Support] Cards migration'
on: [ workflow_dispatch ]
permissions: {}
jobs:
call-migration-workflow:
uses: bitnami/support/.github/workflows/migrate-reusable.yml@main
with:
organization: bitnami
legacy_project_board_name: Support
new_project_number: 4
repo: ${{ github.event.repository.name }}
secrets:
# This token should have access to both projects and at least read:project permissions
token: ${{ secrets.MIGRATION_TOKEN }}
26 changes: 6 additions & 20 deletions .github/workflows/move-closed-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,10 @@ on:
pull_request_target:
types:
- closed
# Remove all permissions by default. Actions are performed by Bitnami Bot
permissions: {}
# Avoid concurrency over the same issue
concurrency:
group: card-movement-${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }}
permissions:
issues: write
pull-requests: write
jobs:
send_to_solved:
runs-on: ubuntu-latest
steps:
- name: Send to the Solved column
id: send-solved
uses: peter-evans/create-or-update-project-card@dfa240db6fe287ceb681e45d6728c1af70452c58
# Send to solve only the issues and PRs created by users or the automated PRs with human review required
if: |
(github.event.issue != null && github.event.issue.user.login != 'bitnami-bot') ||
(github.event.issue == null && (github.event.pull_request.user.login != 'bitnami-bot' || contains(github.event.pull_request.labels.*.name, 'review-required')))
with:
project-name: Support
column-name: 'Solved'
token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
issue-number: ${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }}
call-move-closed-workflow:
uses: bitnami/support/.github/workflows/item-closed.yml@main
secrets: inherit
15 changes: 15 additions & 0 deletions .github/workflows/pr-reviews.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

name: '[Support] Review based card movements'
on:
pull_request_target:
types:
- review_requested
- synchronize
# Remove all permissions by default.
permissions: {}
jobs:
call-pr-review-workflow:
uses: bitnami/support/.github/workflows/pr-review-requested-sync.yml@main
secrets: inherit
18 changes: 18 additions & 0 deletions .github/workflows/reasign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

name: '[Support] Review based card movements'
on:
pull_request:
types:
- labeled
issues:
types:
- labeled
permissions:
pull-requests: write
issues: write
jobs:
call-reasign-workflow:
uses: bitnami/support/.github/workflows/item-labeled.yml@main
secrets: inherit
65 changes: 7 additions & 58 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,11 @@ on:
types:
- reopened
- opened
# Remove all permissions by default
permissions: {}
# Avoid concurrency over the same issue
concurrency:
group: card-movement-${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }}
permissions:
contents: read
pull-requests: write
issues: write
jobs:
# For any opened or reopened issue, should be sent into Triage
send_to_board:
name: Organize triage
runs-on: ubuntu-latest
# Please note that projects cards are created/moved with Bitnami Bot
permissions:
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/
- name: Get author
id: get-issue
run: |
author="${{ github.event.issue != null && github.event.issue.user.login || github.event.pull_request.user.login }}"
number="${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }}"
type="${{ github.event_name != 'issues' && 'pull_request' || 'issue' }}"
echo "author=${author}" >> $GITHUB_OUTPUT
echo "number=${number}" >> $GITHUB_OUTPUT
echo "type=${type}" >> $GITHUB_OUTPUT
- name: Send to the board
if: ${{steps.get-issue.outputs.author != 'bitnami-bot' || steps.get-issue.outputs.type != 'pull_request'}}
uses: peter-evans/create-or-update-project-card@dfa240db6fe287ceb681e45d6728c1af70452c58
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), steps.get-issue.outputs.author)) && 'From Bitnami' || 'Triage' }}
token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
issue-number: ${{ steps.get-issue.outputs.number }}
labeling:
name: Set labels for Automated PRs
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: ${{ github.event_name != 'issues' && github.event.pull_request.user.login == 'bitnami-bot' }}
# The project API is not efficient and requires several requests to create the project card. For that reason we decided to create
# a card for the automated PRs only when it is needed.
steps:
- name: From Bitnami labeling
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
with:
add-labels: 'automated, auto-merge'
- name: Verify labeling
uses: fmulero/labeler@f49bf680252fc8ac12cbebb6e0ed8ea19d0712da
with:
# Bitnami bot token is required to trigger CI workflows
repo-token: ${{ secrets.BITNAMI_BOT_TOKEN }}
add-labels: verify
call-triage-workflow:
uses: bitnami/support/.github/workflows/item-opened.yml@main
secrets: inherit

0 comments on commit f7d34a4

Please sign in to comment.