diff --git a/.github/workflows/call-issue-pr-tracker.yml b/.github/workflows/call-issue-pr-tracker.yml index 87243e2..2c30784 100644 --- a/.github/workflows/call-issue-pr-tracker.yml +++ b/.github/workflows/call-issue-pr-tracker.yml @@ -2,9 +2,11 @@ name: Issue & PR Tracker on: issues: - types: [opened,reopened,labeled,unlabeled] + types: [opened,reopened,labeled,unlabeled,closed] pull_request_target: - types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled] + types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled,closed] + pull_request_review: + types: [submitted,edited,dismissed] jobs: manage-project: diff --git a/.github/workflows/issue-pr-tracker.yml b/.github/workflows/issue-pr-tracker.yml index 7ea5262..1a42923 100644 --- a/.github/workflows/issue-pr-tracker.yml +++ b/.github/workflows/issue-pr-tracker.yml @@ -18,6 +18,10 @@ jobs: project_id: 8 resource_node_id: ${{ github.event.issue.node_id }} status_value: 'Issues' + - name: Add Open Docker Related Issues Not Labeled Invalid (summary comment) + if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && startsWith(github.event.repository.name, 'docker-') && ! contains(github.event.issue.labels.*.name, 'invalid') }} + run: | + echo 'Issue [#${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) is added to [project] column "Issues"' >> $GITHUB_STEP_SUMMARY - 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') }} @@ -27,6 +31,10 @@ jobs: project_id: 8 resource_node_id: ${{ github.event.issue.node_id }} status_value: 'Non-Docker Issues' + - name: Add Open Non-Docker Related Issues Not Labeled Invalid (summary comment) + if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && ! startsWith(github.event.repository.name, 'docker-') && ! contains(github.event.issue.labels.*.name, 'invalid') }} + run: | + echo 'Issue [#${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) is added to [project] column "Non-Docker Issues"' >> $GITHUB_STEP_SUMMARY - 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') }} @@ -36,24 +44,62 @@ jobs: project_id: 8 resource_node_id: ${{ github.event.issue.node_id }} status_value: 'Insufficient Info' + - name: Add Open Issues Labeled Invalid (summary comment) + if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && contains(github.event.issue.labels.*.name, 'invalid') }} + run: | + echo 'Issue [#${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) is added to [project] column "Insufficient Info"' >> $GITHUB_STEP_SUMMARY + - name: Move Closed Issues and PRs to Done + uses: leonsteinhaeuser/project-beta-automations@v2.1.0 + if: ${{ github.event.issue.state == 'closed' || github.event.pull_request.state == 'closed' }} + with: + gh_token: ${{ secrets.CR_PAT }} + organization: linuxserver + project_id: 8 + resource_node_id: ${{ github.event.issue.node_id || github.event.pull_request.node_id }} + status_value: 'Done' + - name: Move Closed Issues and PRs to Done (summary comment) + if: ${{ github.event.issue.state == 'closed' || github.event.pull_request.state == 'closed' }} + run: | + echo 'Issue or PR [#${{ github.event.issue.number || github.event.pull_request.number }}](${{ github.event.issue.html_url || github.event.pull_request.html_url }}) is added to [project] column "Done"' >> $GITHUB_STEP_SUMMARY - 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 }} + 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 Without Review Requests (summary comment) + 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' }} + run: | + echo 'PR [#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) is added to [project] column "PRs"' >> $GITHUB_STEP_SUMMARY - 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) }} + 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: Add Open PRs With Review Requests (summary comment) + 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' }} + run: | + echo 'PR [#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) is added to [project] column "PRs Ready For Team Review"' >> $GITHUB_STEP_SUMMARY + - 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 Approved' + - name: Move Approved PRs (summary comment) + if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review') && github.event.pull_request.state == 'open' && github.event.review.state == 'approved' }} + run: | + echo 'PR [#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) is added to [project] column "PRs Approved"' >> $GITHUB_STEP_SUMMARY - 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') }} @@ -61,3 +107,7 @@ jobs: 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. + - name: Add Comment on Invalid Labeling (summary comment) + if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && github.event.label.name == 'invalid' && contains(github.event.issue.labels.*.name, 'invalid') }} + run: | + echo 'Commented on issue [#${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) that was marked invalid' >> $GITHUB_STEP_SUMMARY