From 640f15f3f30a6b49e234c0f9fbbf78952e8c2813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sat, 19 Oct 2024 17:20:35 +0200 Subject: [PATCH] ci: Bring back stepwise vendoring --- .github/workflows/vendor.yaml | 42 ++++++++++++++++------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/vendor.yaml b/.github/workflows/vendor.yaml index 65b4adbec..fc62d7f7c 100644 --- a/.github/workflows/vendor.yaml +++ b/.github/workflows/vendor.yaml @@ -35,33 +35,29 @@ jobs: - uses: ./.github/workflows/git-identity - - name: Check out or create vendor branch + - name: Vendor sources id: vendor run: | - set -x - if ! git checkout vendor; then - git checkout -b vendor - git push -u origin HEAD + git pull --rebase + ./vendor-one.sh .git/duckdb + rm -rf .git/duckdb + git push --dry-run + # Check if ahead of upstream branch + # If yes, set a step output + if [ $(git rev-list HEAD...origin/main --count) -gt 0 ]; then + # Avoid set-output, it's deprecated + echo "vendor=ok" >> "$GITHUB_OUTPUT" fi - - name: Vendor sources + - name: Create PR + if: steps.vendor.outputs.vendor != '' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git push --dry-run - - # Repeat indefinitely until all commits have been vendored - # https://stackoverflow.com/a/13252187/946850 - while :; do - ./vendor-one.sh .git/duckdb - # Check if ahead of upstream branch - # If yes, push and run workflow - if [ $(git rev-list HEAD...origin/vendor --count) -gt 0 ]; then - git push -u origin HEAD - gh workflow run rcc -f ref=vendor - else - break - fi - done - - rm -rf .git/duckdb + set -x + git checkout -b vendor + if git push -u origin HEAD; then + gh pr create --fill-first + gh workflow run rcc -f ref=vendor + gh pr merge --auto --squash + fi