From 5549c5eb6bac2d5c74aee5aeb3d2c2062c1d0b00 Mon Sep 17 00:00:00 2001 From: Pulumi Bot Date: Tue, 24 Oct 2023 05:24:39 +0000 Subject: [PATCH] [internal] Update GitHub Actions workflow files --- Makefile | 8 ++++---- scripts/upstream.sh | 12 +++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) mode change 100644 => 100755 scripts/upstream.sh diff --git a/Makefile b/Makefile index e62dcc606..7efaef24b 100644 --- a/Makefile +++ b/Makefile @@ -118,17 +118,17 @@ tfgen: install_plugins upstream upstream: ifneq ("$(wildcard upstream)","") - @$(SHELL) ./scripts/upstream.sh "$@" apply + scripts/upstream.sh "$@" apply endif upstream.finalize: - @$(SHELL) ./scripts/upstream.sh "$@" end_rebase + scripts/upstream.sh "$@" end_rebase upstream.rebase: - @$(SHELL) ./scripts/upstream.sh "$@" start_rebase + scripts/upstream.sh "$@" start_rebase bin/pulumi-java-gen: - $(shell pulumictl download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java) + pulumictl download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java # To make an immediately observable change to .ci-mgmt.yaml: # diff --git a/scripts/upstream.sh b/scripts/upstream.sh old mode 100644 new mode 100755 index c455b4655..84f57d7b1 --- a/scripts/upstream.sh +++ b/scripts/upstream.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt set -e @@ -163,8 +164,11 @@ EOF # It is used to make the error message more actionable. end_rebase() { assert_rebase_in_progress "$1" + # Use git to resolve the possible location of files indicating a rebase might be in progress. + rebase_merge_dir=$(cd upstream && git rev-parse --git-path rebase-merge) + rebase_apply_dir=$(cd upstream && git rev-parse --git-path rebase-apply) - if [ -d .git/modules/upstream/rebase-merge ]; then + if [[ -d "${rebase_merge_dir}" || -d "${rebase_apply_dir}" ]]; then echo "rebase still in progress in './upstream'. Please resolve the rebase in" echo "'./upstream' and then run 'make \"$1\"' again." exit 1 @@ -172,8 +176,10 @@ end_rebase() { rm patches/*.patch cd upstream - git format-patch local -o ../patches - rm ../rebase-in-progress + git format-patch local -o ../patches --no-prefix --zero-commit --no-signature --no-stat + cd .. + rm rebase-in-progress + apply "$1" } case $2 in