Skip to content

Commit 640f15f

Browse files
committed
ci: Bring back stepwise vendoring
1 parent e05dcf8 commit 640f15f

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

.github/workflows/vendor.yaml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,29 @@ jobs:
3535

3636
- uses: ./.github/workflows/git-identity
3737

38-
- name: Check out or create vendor branch
38+
- name: Vendor sources
3939
id: vendor
4040
run: |
41-
set -x
42-
if ! git checkout vendor; then
43-
git checkout -b vendor
44-
git push -u origin HEAD
41+
git pull --rebase
42+
./vendor-one.sh .git/duckdb
43+
rm -rf .git/duckdb
44+
git push --dry-run
45+
# Check if ahead of upstream branch
46+
# If yes, set a step output
47+
if [ $(git rev-list HEAD...origin/main --count) -gt 0 ]; then
48+
# Avoid set-output, it's deprecated
49+
echo "vendor=ok" >> "$GITHUB_OUTPUT"
4550
fi
4651
47-
- name: Vendor sources
52+
- name: Create PR
53+
if: steps.vendor.outputs.vendor != ''
4854
env:
4955
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5056
run: |
51-
git push --dry-run
52-
53-
# Repeat indefinitely until all commits have been vendored
54-
# https://stackoverflow.com/a/13252187/946850
55-
while :; do
56-
./vendor-one.sh .git/duckdb
57-
# Check if ahead of upstream branch
58-
# If yes, push and run workflow
59-
if [ $(git rev-list HEAD...origin/vendor --count) -gt 0 ]; then
60-
git push -u origin HEAD
61-
gh workflow run rcc -f ref=vendor
62-
else
63-
break
64-
fi
65-
done
66-
67-
rm -rf .git/duckdb
57+
set -x
58+
git checkout -b vendor
59+
if git push -u origin HEAD; then
60+
gh pr create --fill-first
61+
gh workflow run rcc -f ref=vendor
62+
gh pr merge --auto --squash
63+
fi

0 commit comments

Comments
 (0)