From 24d6b28b5de9e9b7fc393564fc41607cbde9ed32 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Thu, 30 Nov 2023 15:27:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20synced=20file(s)=20with=20bitnam?= =?UTF-8?q?i/support=20(#53312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔄 synced local '.github/workflows/' with remote 'workflows/' Signed-off-by: bitnami-bot --- .github/workflows/comments.yml | 52 +++---------------- .github/workflows/migration.yml | 17 +++++++ .github/workflows/move-closed-issues.yml | 25 +++------ .github/workflows/pr-reviews.yml | 36 +++---------- .github/workflows/reasign.yml | 22 ++++++++ .github/workflows/triage.yml | 64 +++--------------------- 6 files changed, 67 insertions(+), 149 deletions(-) create mode 100644 .github/workflows/migration.yml create mode 100644 .github/workflows/reasign.yml diff --git a/.github/workflows/comments.yml b/.github/workflows/comments.yml index b43181d0090f..017f8837f594 100644 --- a/.github/workflows/comments.yml +++ b/.github/workflows/comments.yml @@ -6,52 +6,14 @@ on: issue_comment: types: - created -# Remove all permissions by default -permissions: {} +permissions: + contents: read + pull-requests: write + issues: write # Avoid concurrency over the same issue concurrency: group: card-movement-${{ github.event.issue.number }} 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 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 \ No newline at end of file diff --git a/.github/workflows/migration.yml b/.github/workflows/migration.yml new file mode 100644 index 000000000000..ae86cb4fb5a1 --- /dev/null +++ b/.github/workflows/migration.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/move-closed-issues.yml b/.github/workflows/move-closed-issues.yml index 589ff23f92b4..d9c7425543b5 100644 --- a/.github/workflows/move-closed-issues.yml +++ b/.github/workflows/move-closed-issues.yml @@ -9,24 +9,13 @@ on: pull_request_target: types: - closed -# Remove all permissions by default. Actions are performed by Bitnami Bot -permissions: {} +permissions: + issues: write + pull-requests: write # Avoid concurrency over the same issue concurrency: - group: card-movement-${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }} + group: card-movement-${{ github.event.repository.id }}-${{ github.event.issue != null && github.event.issue.number || github.event.number }} 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 \ No newline at end of file diff --git a/.github/workflows/pr-reviews.yml b/.github/workflows/pr-reviews.yml index 68fb2a2c1c35..2f3725fbaee4 100644 --- a/.github/workflows/pr-reviews.yml +++ b/.github/workflows/pr-reviews.yml @@ -7,36 +7,12 @@ on: types: - review_requested - synchronize -# Remove all permissions by default -permissions: {} +permissions: + contents: read +# Avoid concurrency over the same issue concurrency: group: card-movement-${{ github.event.number }} jobs: - handler: - runs-on: ubuntu-latest - permissions: - repository-projects: write - contents: read - pull-requests: read - # This job will ignore: - # * Events triggered by bitnami-bot (README commits for example). - # * Events triggered over automated PRs (They are managed in comments.yml workflow). - # * PRs with 'bitnami' label. - if: | - github.actor != 'bitnami-bot' && github.event.pull_request.user.login != 'bitnami-bot' && - (!contains(github.event.pull_request.labels.*.name, 'bitnami')) && (!contains(github.event.pull_request.labels.*.name, 'triage')) - steps: - - name: Repo checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Load .env file - uses: xom9ikk/dotenv@de1ff27d319507880e6621e4d47424c677d95f68 - with: - path: .github/workflows/ - - name: Move into In Progress - # Move the card only if the actor is not a Bitnami member - if: ${{ !contains(fromJson(env.BITNAMI_TEAM), github.actor) }} - uses: peter-evans/create-or-update-project-card@dfa240db6fe287ceb681e45d6728c1af70452c58 - with: - project-name: Support - column-name: In progress - issue-number: ${{ github.event.number }} + call-pr-review-workflow: + uses: bitnami/support/.github/workflows/pr-review-requested-sync.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/reasign.yml b/.github/workflows/reasign.yml new file mode 100644 index 000000000000..ce670f71b28c --- /dev/null +++ b/.github/workflows/reasign.yml @@ -0,0 +1,22 @@ +# Copyright VMware, Inc. +# SPDX-License-Identifier: APACHE-2.0 + +name: '[Support] Review based card movements' +on: + pull_request_target: + types: + - labeled + issues: + types: + - labeled +permissions: + contents: read + pull-requests: write + issues: write +# Avoid concurrency over the same issue +concurrency: + group: card-movement-${{ github.event.issue != null && github.event.issue.number || github.event.number }} +jobs: + call-reasign-workflow: + uses: bitnami/support/.github/workflows/item-labeled.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index df75bc221b2b..880031782dc8 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -12,62 +12,14 @@ on: types: - reopened - opened -# Remove all permissions by default -permissions: {} +permissions: + contents: read + pull-requests: write + issues: write # Avoid concurrency over the same issue concurrency: - group: card-movement-${{ github.event_name != 'issues' && github.event.number || github.event.issue.number }} + group: card-movement-${{ github.event.issue != null && github.event.issue.number || github.event.number }} 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 \ No newline at end of file