Pull Request Review #11
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: Process pull_request_review Events | |
on: | |
pull_request_review: | |
types: | |
- submitted | |
jobs: | |
community_check: | |
name: 'Community Check' | |
uses: ./.github/workflows/community-check.yml | |
secrets: inherit | |
with: | |
username: ${{ github.event.review.user.login }} | |
add_to_project: | |
name: 'Add to Project' | |
runs-on: ubuntu-latest | |
needs: community_check | |
env: | |
GH_TOKEN: ${{ secrets.PROJECT_SCOPED_TOKEN }} | |
# 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.pull_request.html_url }} | |
steps: | |
- name: 'Pull Requests Approved By Maintainers' | |
if: github.event.review.state == 'APPROVED' && needs.community_check.outputs.maintainer == 'true' | |
run: | | |
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} | 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_pending_merge }} | |
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 }} |