63 lines
2.7 KiB
YAML
63 lines
2.7 KiB
YAML
# This workflow is built to manage the triage support by using GH issues.
|
||
name: '[Support] Organize triage'
|
||
on:
|
||
issues:
|
||
types:
|
||
- reopened
|
||
- opened
|
||
pull_request_target:
|
||
types:
|
||
- reopened
|
||
- opened
|
||
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 }}
|
||
jobs:
|
||
# For any opened or reopened issue, should be sent into Triage
|
||
send_to_board:
|
||
name: Organize triage
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: Repo checkout
|
||
uses: actions/checkout@v3
|
||
with:
|
||
fetch-depth: 1
|
||
- name: Load .env file
|
||
uses: xom9ikk/dotenv@v2
|
||
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@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), steps.get-issue.outputs.author)) && 'From Bitnami' || 'Triage' }}
|
||
token: "${{ secrets.BITNAMI_BOT_TOKEN }}"
|
||
issue-number: ${{ steps.get-issue.outputs.number }}
|
||
# 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.
|
||
- name: From Bitnami labeling
|
||
if: ${{steps.get-issue.outputs.author == 'bitnami-bot' && steps.get-issue.outputs.type == 'pull_request'}}
|
||
uses: fmulero/labeler@1.1.0
|
||
with:
|
||
add-labels: 'automated, auto-merge'
|
||
- name: Verify labeling
|
||
if: ${{steps.get-issue.outputs.author == 'bitnami-bot' && steps.get-issue.outputs.type == 'pull_request'}}
|
||
uses: fmulero/labeler@1.1.0
|
||
with:
|
||
# Bitnami bot token is required to trigger CI workflows
|
||
repo-token: ${{ secrets.BITNAMI_BOT_TOKEN }}
|
||
add-labels: verify |