@@ -63,31 +63,37 @@ jobs:
63
63
git checkout vendoring-${{ github.ref_name }}
64
64
git rebase ${{ github.ref_name }}
65
65
# Call the vendoring script in the engine
66
- git rm -rf src/duckdb
66
+ rm -rf src/duckdb
67
67
python vendor.py --duckdb .git/duckdb
68
- git add src/duckdb CMakeLists.txt
69
68
# Clean up
70
69
rm -rf .git/duckdb
71
70
# Export vendor revision for use in later steps
72
71
echo "vendor_rev=${REV}" >> "${GITHUB_OUTPUT}"
73
72
73
+ - name : Check for incoming changes
74
+ if : ${{ steps.vendor.outcome == 'success' }}
75
+ id : check_for_changes
76
+ run : |
77
+ if git diff --exit-code; then
78
+ echo "No vendoring changes detected, skipping the remaining of the job."
79
+ else
80
+ echo "Changes detected, proceeding with commit and push."
81
+ echo "has_changes=true" >> "${GITHUB_OUTPUT}"
82
+ fi
83
+
74
84
- name : Commit and push the changes
75
85
id : commit_and_push
86
+ if : ${{ steps.check_for_changes.outcome == 'success' && steps.check_for_changes.outputs.has_changes == 'true' }}
76
87
run : |
77
88
MSG="Update vendored DuckDB sources to ${{ steps.vendor.outputs.vendor_rev }}"
89
+ git add src/duckdb CMakeLists.txt
78
90
git commit -m "${MSG}"
79
- # Check if ahead of upstream branch
80
- # If yes, set a step output
81
- git push -f --dry-run origin vendoring-${{ github.ref_name }}
82
- if [ $(git rev-list HEAD...origin/${{ github.ref_name }} --count) -gt 0 ]; then
83
- git push -f origin vendoring-${{ github.ref_name }}
84
- # Avoid set-output, it's deprecated
85
- echo "push_performed=true" >> "${GITHUB_OUTPUT}"
86
- echo "commit_msg=${MSG}" >> "${GITHUB_OUTPUT}"
87
- fi
91
+ git push -f origin vendoring-${{ github.ref_name }}
92
+ echo "commit_msg=${MSG}" >> "${GITHUB_OUTPUT}"
88
93
89
94
- name : Check PR exists
90
95
id : check_pr_exists
96
+ if : ${{ steps.commit_and_push.outcome == 'success' }}
91
97
env :
92
98
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
93
99
run : |
@@ -103,6 +109,7 @@ jobs:
103
109
104
110
- name : Prepare PR message
105
111
id : prepare_pr_message
112
+ if : ${{ steps.check_pr_exists.outcome == 'success' }}
106
113
run : |
107
114
DATE="$(date +"%Y-%m-%d %H:%M:%S")"
108
115
CHANGE_LABEL="duckdb/duckdb#${{ steps.vendor.outputs.vendor_rev }}"
@@ -113,7 +120,7 @@ jobs:
113
120
114
121
- name : Create PR
115
122
id : create_pr
116
- if : ${{ steps.check_pr_exists.outputs.pr_exists == 'false' }}
123
+ if : ${{ steps.prepare_pr_message.outcome == 'success' && steps. check_pr_exists.outputs.pr_exists == 'false' }}
117
124
env :
118
125
# We cannot use default workflow's GITHUB_TOKEN here, because
119
126
# it is restricted to not trigger 'pull_request' event that
@@ -133,7 +140,7 @@ jobs:
133
140
134
141
- name : Update PR
135
142
id : update_pr
136
- if : ${{ steps.check_pr_exists.outputs.pr_exists == 'true' }}
143
+ if : ${{ steps.prepare_pr_message.outcome == 'success' && steps. check_pr_exists.outputs.pr_exists == 'true' }}
137
144
env :
138
145
# We cannot use default workflow's GITHUB_TOKEN here, because
139
146
# it is restricted to not trigger 'pull_request' event that
0 commit comments