Skip to content
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

Extend project automation #1842

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/project-automation-helper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Project automation helper
on:
workflow_call:
inputs:
resource_node_id:
required: true
type: string
status_value:
required: true
type: string

jobs:
workflow_call:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_call'
steps:
- uses: leonsteinhaeuser/project-beta-automations@v2.1.0
with:
gh_app_ID: ${{ secrets.AUTOMATION_APP_ID }}
gh_app_installation_ID: ${{ secrets.AUTOMATION_APP_INSTALLATION_ID }}
gh_app_secret_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
organization: OpenSlides
project_id: 2
resource_node_id: ${{ inputs.resource_node_id }}
status_value: ${{ inputs.status_value }}
33 changes: 6 additions & 27 deletions .github/workflows/project-automation.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
name: Project automation
on:
workflow_call:
inputs:
resource_node_id:
required: true
type: string
status_value:
required: true
type: string
issues:
types:
- opened
Expand All @@ -24,52 +16,39 @@ on:
- submitted

jobs:
workflow_call:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_call'
steps:
- uses: leonsteinhaeuser/project-beta-automations@v2.1.0
with:
gh_app_ID: ${{ secrets.AUTOMATION_APP_ID }}
gh_app_installation_ID: ${{ secrets.AUTOMATION_APP_INSTALLATION_ID }}
gh_app_secret_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
organization: OpenSlides
project_id: 2
resource_node_id: ${{ inputs.resource_node_id }}
status_value: ${{ inputs.status_value }}
issue_opened:
if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened')
uses: ./.github/workflows/project-automation.yml
uses: ./.github/workflows/project-automation-helper.yml
with:
resource_node_id: ${{ github.event.issue.node_id }}
status_value: "Planning"
pull_request_opened:
if: github.event_name == 'pull_request_target' && (github.event.action == 'opened' || github.event.action == 'reopened')
uses: ./.github/workflows/project-automation.yml
uses: ./.github/workflows/project-automation-helper.yml
with:
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: "Work in progress"
pull_request_review_requested:
if: github.event_name == 'pull_request_target' && github.event.action == 'review_requested'
uses: ./.github/workflows/project-automation.yml
uses: ./.github/workflows/project-automation-helper.yml
with:
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: "Review in progress"
pull_request_changes_requested:
if: github.event_name == 'pull_request_review' && github.event.review.state == 'changes_requested'
uses: ./.github/workflows/project-automation.yml
uses: ./.github/workflows/project-automation-helper.yml
with:
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: "Work in progress"
pull_request_approved:
if: github.event_name == 'pull_request_review' && github.event.review.state == 'approved'
uses: ./.github/workflows/project-automation.yml
uses: ./.github/workflows/project-automation-helper.yml
with:
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: "Reviewer approved"
pull_request_or_issue_closed:
if: github.event.action == 'closed'
uses: ./.github/workflows/project-automation.yml
uses: ./.github/workflows/project-automation-helper.yml
with:
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: "Done"