Skip to content

Commit 73d7953

Browse files
committed
ci: attempt to specify main branch
1 parent 8848399 commit 73d7953

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/ci_check_release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ jobs:
161161
uses: actions/checkout@v4
162162
with:
163163
fetch-depth: 0 # Fetch all history
164+
ref: main # Explicitly checkout main branch
164165

165166
- name: Set up Python
166167
uses: actions/setup-python@v5
@@ -187,6 +188,16 @@ jobs:
187188
echo "CREATE_RELEASE=false" >> $GITHUB_ENV
188189
fi
189190
191+
- name: Find Previous Release
192+
if: env.CREATE_RELEASE == 'true'
193+
id: previous_release
194+
run: |
195+
git fetch --tags
196+
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
197+
if [ -n "$PREV_TAG" ]; then
198+
echo "PREV_TAG=${PREV_TAG}" >> $GITHUB_ENV
199+
fi
200+
190201
- name: Generate Release Notes
191202
if: env.CREATE_RELEASE == 'true'
192203
id: release_notes
@@ -196,18 +207,10 @@ jobs:
196207
version: ${{ env.VERSION }}
197208
tag: ${{ env.VERSION }}
198209
disable-releaser: true # Prevent creating a draft release
210+
commitish: main # Explicitly use main branch
199211
env:
200212
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
201213

202-
- name: Find Previous Release
203-
if: env.CREATE_RELEASE == 'true'
204-
id: previous_release
205-
run: |
206-
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
207-
if [ -n "$PREV_TAG" ]; then
208-
echo "PREV_TAG=${PREV_TAG}" >> $GITHUB_ENV
209-
fi
210-
211214
- name: Generate Compare URL
212215
if: env.CREATE_RELEASE == 'true'
213216
id: compare_url
@@ -230,5 +233,6 @@ jobs:
230233
**Full Changelog**: ${{ env.URL }}
231234
draft: false
232235
prerelease: false
236+
commitish: main # Explicitly use main branch
233237
env:
234238
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)