add-to-project workflow: automatically add reviewers without need of CODEOWNERS #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Project Management | ||
on: | ||
issues: | ||
types: | ||
- labeled | ||
pull_request: | ||
branches: [ main ] | ||
types: | ||
- labeled | ||
- ready_for_review | ||
workflow_call: | ||
inputs: | ||
labeled: | ||
required: false | ||
default: bug, ci, dependencies, documentation, feature, refactor, security, customer | ||
type: string | ||
project-url: | ||
required: false | ||
type: string | ||
reviewers-team: | ||
required: false | ||
default: 'backend-devs' | ||
type: string | ||
reviewers-individuals: | ||
required: false | ||
type: string | ||
jobs: | ||
add-to-project: | ||
name: Add issue/PR to a project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
# You can target a project in a different organization | ||
# to the issue | ||
project-url: ${{ inputs.project-url != '' && inputs.project-url || secrets.PLATFORM_PROJECT_URL }} | ||
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} | ||
labeled: ${{ inputs.labeled }} | ||
assing-pr-to-creator: | ||
name: Assign PR to creator | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Assign PR to creator | ||
uses: thomaseizinger/[email protected] | ||
if: github.event_name == 'pull_request' | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
add-reviewer-to-pr: | ||
name: Assign Reviewer to PR | ||
runs-on: ubuntu-latest | ||
permissions: read-all|write-all | ||
steps: | ||
- if: github.event_name == 'pull_request' | ||
uses: rowi1de/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
teams: ${{ inputs.reviewers-team != '' && inputs.reviewers-team || 'backend-devs' }} # only works for GitHub Organisation/Teams | ||
persons: ${{ inputs.reviewers-individuals }} # add individual persons here | ||
include-draft: false # Draft PRs will be skipped (default: false) | ||
skip-with-manual-reviewers: 1 # Skip this action, if the number of reviwers was already assigned (default: 0) |