Skip to content

Commit e6f45a7

Browse files
committed
fix: step "Check for changes since last nightly" needs to run before "Determine version and channel"
1 parent 69e7ac3 commit e6f45a7

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

.github/workflows/publish-marketplace.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,26 @@ jobs:
3333
- name: Grant execute permission for gradlew
3434
run: chmod +x gradlew
3535

36+
- name: Check for changes since last nightly
37+
if: github.event_name == 'schedule'
38+
id: changes_check
39+
run: |
40+
# Get the date from yesterday
41+
YESTERDAY=$(date -d 'yesterday' +%Y-%m-%d)
42+
echo "Checking for changes since: $YESTERDAY"
43+
44+
# Get the last nightly build commit hash (you might want to store this in a file or use a tag)
45+
# For now, we'll check if there are any commits in the last 24 hours
46+
COMMIT_COUNT=$(git log --since="$YESTERDAY" --oneline | wc -l)
47+
48+
if [ "$COMMIT_COUNT" -gt 0 ]; then
49+
echo "✅ Found $COMMIT_COUNT commits since $YESTERDAY - proceeding with nightly build"
50+
echo "has_changes=true" >> $GITHUB_OUTPUT
51+
else
52+
echo "ℹ️ No commits since $YESTERDAY - skipping nightly build"
53+
echo "has_changes=false" >> $GITHUB_OUTPUT
54+
fi
55+
3656
- name: Determine version and channel
3757
id: version_info
3858
run: |
@@ -74,26 +94,6 @@ jobs:
7494
echo "CHANNEL=$CHANNEL" >> $GITHUB_OUTPUT
7595
echo "Publishing version $VERSION to $CHANNEL channel"
7696
77-
- name: Check for changes since last nightly
78-
if: github.event_name == 'schedule'
79-
id: changes_check
80-
run: |
81-
# Get the date from yesterday
82-
YESTERDAY=$(date -d 'yesterday' +%Y-%m-%d)
83-
echo "Checking for changes since: $YESTERDAY"
84-
85-
# Get the last nightly build commit hash (you might want to store this in a file or use a tag)
86-
# For now, we'll check if there are any commits in the last 24 hours
87-
COMMIT_COUNT=$(git log --since="$YESTERDAY" --oneline | wc -l)
88-
89-
if [ "$COMMIT_COUNT" -gt 0 ]; then
90-
echo "✅ Found $COMMIT_COUNT commits since $YESTERDAY - proceeding with nightly build"
91-
echo "has_changes=true" >> $GITHUB_OUTPUT
92-
else
93-
echo "ℹ️ No commits since $YESTERDAY - skipping nightly build"
94-
echo "has_changes=false" >> $GITHUB_OUTPUT
95-
fi
96-
9797
- name: Build nightly version
9898
if: (github.event_name == 'schedule' && steps.changes_check.outputs.has_changes == 'true') || github.event_name == 'workflow_dispatch'
9999
run: |

0 commit comments

Comments
 (0)