Skip to content

Split actions into smaller steps#13

Merged
zegl merged 1 commit intomainfrom
labeler
May 31, 2022
Merged

Split actions into smaller steps#13
zegl merged 1 commit intomainfrom
labeler

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