Skip to content

Commit

Permalink
Merge pull request #39085 from hashicorp/remove-former-community-check
Browse files Browse the repository at this point in the history
Remove outdated "community check" reusable workflow
  • Loading branch information
justinretzolk authored Aug 30, 2024
2 parents 46b48b0 + f46778b commit d1934f9
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 151 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/community-check.yml

This file was deleted.

177 changes: 90 additions & 87 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Process issues Events'
name: "Process issues Events"

on:
issues:
Expand All @@ -10,115 +10,118 @@ on:
- labeled

jobs:
community_check:
name: 'Community Check'
uses: ./.github/workflows/community-check.yml
secrets: inherit
with:
# This is a ternary that sets the variable to the assigned user's login on assigned events,
# and otherwise sets it to the username of the pull request's author. For more information:
# https://docs.github.com/en/actions/learn-github-actions/expressions#example
username: ${{ github.event.action == 'assigned' && github.event.assignee.login || github.event.issue.user.login }}

automation_labeler:
name: 'Automation Labeler'
needs: community_check
labels:
name: Labelers
runs-on: ubuntu-latest
env:
ISSUE_URL: ${{ github.event.issue.html_url }}
permissions:
contents: read
issues: write

steps:
- name: 'Generate Token'
id: token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
app_id: ${{ secrets.APP_ID }}
installation_retrieval_mode: id
installation_retrieval_payload: ${{ secrets.INSTALLATION_ID }}
private_key: ${{ secrets.APP_PEM }}

- name: 'Add needs-triage for non-maintainer'
if: github.event.action == 'opened' && needs.community_check.outputs.maintainer == 'false'
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: gh issue edit ${{ env.ISSUE_URL }} --add-label needs-triage

- name: 'Add prioritized when assigned to maintainers'
if: github.event.action == 'assigned' && needs.community_check.outputs.maintainer == 'true'
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: gh issue edit ${{ env.ISSUE_URL }} --add-label prioritized

- name: 'Remove unnecessary labels on closure'
if: github.event.action == 'closed'
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: gh issue edit ${{ env.ISSUE_URL }} --remove-label needs-triage,waiting-response
sparse-checkout: .github

service_labeler:
name: 'Service Labeler'
if: contains(fromJSON('["opened", "edited"]'), github.event.action)
runs-on: ubuntu-latest
steps:
- name: 'Apply Labels'
- name: Apply Service Labels
if: contains(fromJSON('["opened", "edited"]'), github.event.action)
uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler-issue-triage.yml
enable-versioned-regex: 0
include-title: 1

add_to_project:
name: 'Add to Project'
- name: Run Community Check
id: community_check
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.action == 'assigned' && github.event.assignee.login || github.event.issue.user.login }}
maintainers: ${{ secrets.MAINTAINERS }}

- name: Add needs-triage to New Issues
if: |
github.event.action == 'opened'
&& steps.community_check.outputs.maintainer == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh issue edit ${{ github.event.issue.html_url }} --add-label needs-triage

- name: Add prioritized When Assigned to a Maintainer
if: |
github.event.action == 'assigned'
&& steps.community_check.outputs.maintainer == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh issue edit ${{ github.event.issue.html_url }} --add-label prioritized

- name: Remove Triage labels on Closure
if: |
github.event.action == 'closed'
&& (contains(github.event.issue.labels.*.name, 'needs-triage') || contains(github.event.issue.labels.*.name, 'waiting-response'))
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh issue edit ${{ github.event.issue.html_url }} --remove-label needs-triage,waiting-response

project:
name: Maintainer Work Board
runs-on: ubuntu-latest
needs: community_check
env:
# Some gh project calls take the project's ID, some take the project's number
PROJECT_ID: "PVT_kwDOAAuecM4AF-7h"
PROJECT_NUMBER: "196"
STATUS_FIELD_ID: "PVTSSF_lADOAAuecM4AF-7hzgDcsQA"
VIEW_FIELD_ID: "PVTSSF_lADOAAuecM4AF-7hzgMRB34"
ITEM_URL: ${{ github.event.issue.html_url }}
permissions:
contents: read
steps:
- name: 'Generate Token'
- name: Generate GitHub App Token
id: token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
with:
app_id: ${{ secrets.APP_ID }}
installation_retrieval_mode: id
installation_retrieval_payload: ${{ secrets.INSTALLATION_ID }}
private_key: ${{ secrets.APP_PEM }}
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PEM }}

- name: 'Assigned to Maintainer'
if: github.event.action == 'assigned' && needs.community_check.outputs.maintainer == 'true'
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: |
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} --format json | jq '.id')
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.STATUS_FIELD_ID }} --single-select-option-id ${{ vars.team_project_status_in_progress }}
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_working_board }}
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
sparse-checkout: .github/actions/

- name: 'Labeled Prioritized'
- name: Run Community Check
id: community_check
if: github.event.action == 'assigned'
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.assignee.login }}
maintainers: ${{ secrets.MAINTAINERS }}

- name: Add Maintainer Assignments
if: |
github.event.action == 'assigned'
&& steps.community_check.outputs.maintainer == 'true'
uses: ./.github/actions/team_working_board
with:
github_token: ${{ steps.token.outputs.token }}
item_url: ${{ github.event.issue.html_url }}
status: "In Progress"
view: "working-board"

- name: Add Issues Labeled prioritized
if: github.event.label.name == 'prioritized'
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: |
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} --format json | jq '.id')
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_working_board }}
uses: ./.github/actions/team_working_board
with:
github_token: ${{ steps.token.outputs.token }}
item_url: ${{ github.event.issue.html_url }}
view: "working-board"

- name: 'Labeled Engineering Initiative'
- name: Add Issues Labeled engineering-initiative
if: github.event.label.name == 'engineering-initiative'
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: |
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} --format json | jq '.id')
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_engineering_initiative }}
uses: ./.github/actions/team_working_board
with:
github_token: ${{ steps.token.outputs.token }}
item_url: ${{ github.event.issue.html_url }}
view: "engineering-initiative"

community_note:
name: 'Add Community Note'
name: "Add Community Note"
if: github.event.action == 'opened'
runs-on: ubuntu-latest
steps:
- name: 'Add community note to new Issues'
- name: "Add community note to new Issues"
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.issue.number }}
Expand All @@ -137,11 +140,11 @@ jobs:
* If this would be your first contribution, please review the [contribution guide](https://hashicorp.github.io/terraform-provider-aws/).
closed_issue_comment:
name: 'Closed Issue Comment'
name: "Closed Issue Comment"
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: 'Add comment on closed issues'
- name: "Add comment on closed issues"
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.issue.number }}
Expand Down

0 comments on commit d1934f9

Please sign in to comment.