Skip to content

ci: Add some additional GH project automation #13608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
61 changes: 61 additions & 0 deletions .github/workflows/project-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Automation: Update GH Project"
on:
pull_request:
types:
- closed
- opened
- reopened
- ready_for_review

jobs:
# When a PR is a draft, it should go into "In Progress"
mark_as_in_progress:
if: |
(github.event.action == 'opened' || github.event.action == 'reopened')
&& github.event.pull_request.draft == true
runs-on: ubuntu-latest
steps:
- name: Update status to in_progress
id: update_status
uses: peter-evans/create-or-update-project-card@v3
with:
token: ${{ secrets.GH_PROJECT_AUTOMATION }}
project-location: getsentry
project-number: 31
column-name: "🏗 In Progress"
issue-number: ${{ github.event.number }}

# When a PR is not a draft, it should go into "In Review"
mark_as_in_review:
if: |
(github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'ready_for_review')
&& github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Update status to in_review
id: update_status
uses: github/update-project-action@v3
with:
github_token: ${{ secrets.GH_PROJECT_AUTOMATION }}
organization: getsentry
project_number: 31
content_id: ${{ github.event.number }}
field: Status
value: "👀 In Review"

# By default, closed PRs go into "Ready for Release"
# But if they are closed without merging, they should go into "Done"
mark_as_done:
if: |
github.event.action == 'closed' && github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- name: Update status to done
id: update_status
uses: peter-evans/create-or-update-project-card@v3
with:
token: ${{ secrets.GH_PROJECT_AUTOMATION }}
project-location: getsentry
project-number: 31
column-name: "✅ Done"
issue-number: ${{ github.event.number }}
Loading