chrismdp / retry-a-build

A failed build tries again

Public ·
Version 1 of 3
  1. #3 · chrismdp · · 0.8Latest
  2. #2 · chrismdp · · 0.6
  3. #1 · chrismdp · · 0.6Showing
Fork

workflow.yaml

workflow.yaml is AWML 0.6, as it was pushed. The registry draws, checks and fits it converted to AWML 0.8.

# A try that failed, by a check, by CI or by a review's Important finding, starts the build again,
# up to three tries in all, each time telling Claude why the last one failed. After three, why it
# failed is commented on the issue.
awml: "0.6"
title: A failed build tries again
scopes:
  - { id: public, label: "public: anyone who reads the repository", processing: any }
parts:
  - { id: tryfailed, kind: trigger, label: "A try failed" }
  - { id: token, kind: connector, label: "The repository, through its own Actions token", in: public, ref: issue-to-pull-request.yaml#token }
  - { id: bring, kind: code, op: bring-in, label: "Bring in why it failed: the failed checks' log", in: public }
  - { id: failed, kind: context, label: "Why the last try failed", in: public }
  - { id: tries, kind: code, op: sort, label: "Sort by rule: has it tried three times?", in: public }
  - { id: again, kind: code, op: do, label: "Start the build again, with why this try failed", in: public }
  - { id: dispatch, kind: trigger, label: "A failed try starts the build again", ref: issue-to-pull-request.yaml#dispatch }
  - { id: report, kind: code, op: do, label: "Comment on the issue with why the build failed", in: public }
  - { id: issuenote, kind: outside, label: "Comment on the issue: Allow", in: public }
  - { id: update, kind: code, op: do, label: "Edit the status comment: the build failed", in: public }
  - { id: status, kind: outside, label: "Edit the build's status comment: Allow", in: public }
  - { id: same, kind: comment, label: "Only this workflow starts a retry, and only for an issue a label already started. Each retry carries the try's number and the name of the person who added the label" }
lines:
  - { from: tryfailed, to: bring, kind: start }
  - { from: token, to: bring, kind: data, label: "the failed run's log" }
  - { from: bring, to: failed, kind: data }
  - { from: bring, to: tries, kind: start }
  - { from: tries, to: again, kind: start, label: "[fewer than three]" }
  - { from: tries, to: report, kind: start, label: "[three]" }
  - { from: again, to: dispatch, kind: start, label: "the issue and why it failed" }
  - { from: failed, to: report, kind: data }
  - { from: report, to: issuenote, kind: data }
  - { from: issuenote, to: token, kind: data }
  - { from: report, to: update, kind: start }
  - { from: update, to: status, kind: data }
  - { from: status, to: token, kind: data }
  - { from: same, to: again, kind: tie }
implementations:
  actions:
    label: GitHub Actions, retry.yml
    blocks:
      - { id: github, label: "GitHub: issues and runs", parts: [tryfailed, dispatch, token, failed, issuenote, status] }
      - { id: retryjob, label: "Actions job: retry or report, running nothing from the change", platform: actions-code, parts: [bring, tries, again, report, update] }