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

Split actions into smaller steps #13

Merged
merged 1 commit into from
May 31, 2022
Merged

Split actions into smaller steps #13

merged 1 commit into from
May 31, 2022

Conversation

zegl
Copy link
Contributor

@zegl zegl commented May 30, 2022

  • Baller - Schedule and trigger Codeball Jobs
  • Status - Wait for Codeball Result
  • Approver - Approve PRs
  • Labeler - Label PRs

Status outputs a boolean with the result, and the user can use if-conditions
to trigger the Approver and Labeler actions as desired.

This is a breaking change (to the Approver action), and would only be released
under a new major version.


Here's an example of how it can be used:

on: [pull_request]

permissions:
  contents: read
  issues: write
  pull-requests: write

jobs:
  codeball:
    runs-on: ubuntu-latest
    name: Codeball
    steps:
      # Start a new Codeball review job
      # This step is asynchronous and will return a job id
      - name: Trigger Codeball
        id: codeball_baller
        uses: sturdy-dev/codeball-action/baller@labeler

      # Wait for Codeball results, and populate the "approved" output
      - name: Get Status
        id: codeball_status
        uses: sturdy-dev/codeball-action/status@labeler
        with:
          codeball-job-id: ${{ steps.codeball_baller.outputs.codeball-job-id }}

      # The following actions are fully customisable by the user, to create any desired workflow

      - name: Label Approved
        uses: sturdy-dev/codeball-action/labeler@labeler
        if: ${{ steps.codeball_status.outputs.approved == 'true' }}
        with:
          name: "codeball:approved"
          color: "86efac" # green

      - name: Label Needs Review
        uses: sturdy-dev/codeball-action/labeler@labeler
        if: ${{ steps.codeball_status.outputs.approved == 'false' }}
        with:
          name: "codeball:needs-review"
          color: "bfdbfe" # blue

      - name: Approve PR
        uses: sturdy-dev/codeball-action/approver@labeler
        if: ${{ steps.codeball_status.outputs.approved == 'true' }}

* Baller - Schedule and trigger Codeball Jobs
* Status - Wait for Codeball Result
* Approver - Approve PRs
* Labeler - Label PRs

Status outputs a boolean with the result, and the user can use if-conditions
to trigger the Approver and Labeler actions as desired.

This is a breaking change (to the Approver action), and would only be relased
under a new major version.
@zegl zegl requested review from krlvi and ngalaiko May 30, 2022 16:13
@krlvi
Copy link
Member

krlvi commented May 31, 2022

Looks reasonable to me. The only comment i have is lets use "needs review" or "needs human review" instead of the term rejection, since we target a high precision at the cost of lower recall.

@zegl zegl merged commit 7825ba8 into main May 31, 2022
@zegl zegl deleted the labeler branch May 31, 2022 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants