diff --git a/.github/workflows/project-automation-helper.yml b/.github/workflows/project-automation-helper.yml new file mode 100644 index 000000000..e1a8731a3 --- /dev/null +++ b/.github/workflows/project-automation-helper.yml @@ -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 }} diff --git a/.github/workflows/project-automation.yml b/.github/workflows/project-automation.yml index a25bf0d32..66b1100aa 100644 --- a/.github/workflows/project-automation.yml +++ b/.github/workflows/project-automation.yml @@ -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 @@ -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"