allow running on a ref instead of a PR

When running from a PR, the ref is the head of the PR in the origin
repository. The PR is used to:

* display comments about the location of the destination PR
* asynchronously close / merge the destination PR when something
  happens in the origin PR

When only the ref is available, the destination PR must be closed and
the corresponding branch destroyed immediately after it concludes
because there is no convenient way to know what or when something
else will happen.
This commit is contained in:
Earl Warren 2024-01-02 18:39:58 +01:00
parent 0e9a4e846b
commit 0c3c8b591b
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
12 changed files with 326 additions and 85 deletions

View file

@ -0,0 +1,14 @@
#!/bin/bash
set -ex
destination_checkout="$1"
destination_pr_json="$2"
origin_checkout="$3"
origin_ref="$4"
test -d $destination_checkout
test -d $origin_checkout
test "$origin_ref"
date +%s > $destination_checkout/last