add issue & pr tracker callable workflow

This commit is contained in:
aptalca 2023-03-20 12:43:36 -04:00
parent 0b30f0cb81
commit efaf572587
No known key found for this signature in database
GPG Key ID: BE36CFFB9FD85548
3 changed files with 77 additions and 12 deletions

View File

@ -1,12 +0,0 @@
name: Comment on invalid interaction
on:
issues:
types:
- labeled
jobs:
add-comment-on-invalid:
if: github.event.label.name == 'invalid'
permissions:
issues: write
uses: linuxserver/github-workflows/.github/workflows/invalid-interaction-helper.yml@v1
secrets: inherit

View File

@ -0,0 +1,14 @@
name: Issue & PR Tracker
on:
issues:
types: [opened,reopened,labeled,unlabeled]
pull_request_target:
types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled]
jobs:
manage-project:
permissions:
issues: write
uses: linuxserver/github-workflows/.github/workflows/issue-pr-tracker.yml@v1
secrets: inherit

63
.github/workflows/issue-pr-tracker.yml vendored Normal file
View File

@ -0,0 +1,63 @@
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: Add Open PRs Without Review Requests
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.state == 'open' && github.event.pull_request.requested_reviewers[0] == null && github.event.pull_request.requested_teams[0] == null }}
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.pull_request.state == 'open' && (github.event.pull_request.requested_reviewers[0] != null || github.event.pull_request.requested_teams[0] != null) }}
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'
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.