File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,8 @@ jobs:
183
183
steps :
184
184
- uses : actions/checkout@v4
185
185
with :
186
+ # Required because otherwise there are always changes detected when executing diff/rev-list
187
+ fetch-depth : 0
186
188
# If no PAT is used the following error occurs on a push:
187
189
# refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission
188
190
token : ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
@@ -208,7 +210,7 @@ jobs:
208
210
209
211
echo "Checking if update-branch-merged exists"
210
212
git fetch
211
- if [[ $(git rev-parse origin/ ${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
213
+ if [[ $(git ls-remote --exit-code --heads origin ${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
212
214
echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"
213
215
exit 0
214
216
fi
@@ -269,8 +271,11 @@ jobs:
269
271
base_branch=$(git branch --show-current)
270
272
echo "Base branch is $base_branch"
271
273
272
- echo "Fetching..."
273
- git fetch
274
+ echo "Fully fetching..."
275
+ git fetch --unshallow || true
276
+ git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
277
+ git fetch origin
278
+
274
279
if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
275
280
echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"
276
281
exit 0
You can’t perform that action at this time.
0 commit comments