forgejo-ci: if not draft, nuke file from -testing branch
Some checks failed
/ lint (pull_request) Failing after 27s
/ build-x86_64 (pull_request) Successful in 2m10s
/ deploy-x86_64 (pull_request) Successful in 25s
/ build-aarch64 (pull_request) Successful in 8m17s
/ deploy-aarch64 (pull_request) Successful in 55s

This commit is contained in:
Antoine Martin 2024-08-23 00:18:00 -04:00
parent f815fbf7a5
commit fa8b63c7af
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -15,7 +15,11 @@ for apk in $apkgs; do
name=$(echo $apk | awk -F '/' '{print $4}') name=$(echo $apk | awk -F '/' '{print $4}')
if [ "$(curl -s $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/pulls/$GITHUB_EVENT_NUMBER | jq .draft)" == "true" ]; then if [ "$(curl -s $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/pulls/$GITHUB_EVENT_NUMBER | jq .draft)" == "true" ]; then
# if draft, send to -testing branch
branch="$branch-testing" branch="$branch-testing"
else
# if not draft, assume that this was sent to $branch-testing and nuke it
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch-testing/$arch/$name
fi fi
echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch" echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch"