mirror of
https://github.com/linuxserver/github-workflows.git
synced 2026-03-02 00:02:48 +08:00
Act on issue and PR close action and move to Done Act on review submission and move to PRs approved
91 lines
4.7 KiB
YAML
91 lines
4.7 KiB
YAML
name: Callable Issue & PR Tracker
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
manage-project:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
issues: write
|
|
steps:
|
|
- name: Add Open Docker Related Issues Not Labeled Invalid
|
|
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && startsWith(github.event.repository.name, 'docker-') && ! contains(github.event.issue.labels.*.name, 'invalid') }}
|
|
with:
|
|
gh_token: ${{ secrets.CR_PAT }}
|
|
organization: linuxserver
|
|
project_id: 8
|
|
resource_node_id: ${{ github.event.issue.node_id }}
|
|
status_value: 'Issues'
|
|
- name: Add Open Non-Docker Related Issues Not Labeled Invalid
|
|
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && ! startsWith(github.event.repository.name, 'docker-') && ! contains(github.event.issue.labels.*.name, 'invalid') }}
|
|
with:
|
|
gh_token: ${{ secrets.CR_PAT }}
|
|
organization: linuxserver
|
|
project_id: 8
|
|
resource_node_id: ${{ github.event.issue.node_id }}
|
|
status_value: 'Non-Docker Issues'
|
|
- name: Add Open Issues Labeled Invalid
|
|
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && contains(github.event.issue.labels.*.name, 'invalid') }}
|
|
with:
|
|
gh_token: ${{ secrets.CR_PAT }}
|
|
organization: linuxserver
|
|
project_id: 8
|
|
resource_node_id: ${{ github.event.issue.node_id }}
|
|
status_value: 'Insufficient Info'
|
|
- name: Move Closed Issues to Done
|
|
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
if: ${{ github.event.issue.state == 'closed' }}
|
|
with:
|
|
gh_token: ${{ secrets.CR_PAT }}
|
|
organization: linuxserver
|
|
project_id: 8
|
|
resource_node_id: ${{ github.event.issue.node_id }}
|
|
status_value: 'Done'
|
|
- name: Move Closed PRs to Done
|
|
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
if: ${{ github.event.pull_request.state == 'closed' }}
|
|
with:
|
|
gh_token: ${{ secrets.CR_PAT }}
|
|
organization: linuxserver
|
|
project_id: 8
|
|
resource_node_id: ${{ github.event.pull_request.node_id }}
|
|
status_value: 'Done'
|
|
- name: Add Open PRs Without Review Requests
|
|
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review') && github.event.pull_request.state == 'open' && github.event.pull_request.requested_reviewers[0] == null && github.event.pull_request.requested_teams[0] == null && github.event.review.state != 'approved' }}
|
|
with:
|
|
gh_token: ${{ secrets.CR_PAT }}
|
|
organization: linuxserver
|
|
project_id: 8
|
|
resource_node_id: ${{ github.event.pull_request.node_id }}
|
|
status_value: 'PRs'
|
|
- name: Add Open PRs With Review Requests
|
|
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review') && github.event.pull_request.state == 'open' && (github.event.pull_request.requested_reviewers[0] != null || github.event.pull_request.requested_teams[0] != null) && github.event.review.state != 'approved' }}
|
|
with:
|
|
gh_token: ${{ secrets.CR_PAT }}
|
|
organization: linuxserver
|
|
project_id: 8
|
|
resource_node_id: ${{ github.event.pull_request.node_id }}
|
|
status_value: 'PRs Ready For Team Review'
|
|
- name: Move Approved PRs
|
|
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
|
|
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review') && github.event.pull_request.state == 'open' && github.event.review.state == 'approved' }}
|
|
with:
|
|
gh_token: ${{ secrets.CR_PAT }}
|
|
organization: linuxserver
|
|
project_id: 8
|
|
resource_node_id: ${{ github.event.pull_request.node_id }}
|
|
status_value: 'PRs Ready For Team Review'
|
|
- name: Add Comment on Invalid Labeling
|
|
uses: peter-evans/create-or-update-comment@v2.1.1
|
|
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && github.event.label.name == 'invalid' && contains(github.event.issue.labels.*.name, 'invalid') }}
|
|
with:
|
|
issue-number: ${{ github.event.issue.number}}
|
|
body: |
|
|
A human has marked this issue as invalid, this likely happened because the issue template was not used in the creation of the issue.
|