Skip to content

Commit 37f207b

Browse files
Fixing changelog step.
1 parent 2b0c821 commit 37f207b

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

.github/workflows/eas-android-build.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,37 @@ jobs:
185185
steps:
186186
- name: Checkout repository
187187
uses: actions/checkout@v4
188+
with:
189+
fetch-depth: 0 # Ensures full history is available
188190

189191
- name: Generate Changelog
190192
id: changelog
191193
run: |
192-
git fetch --prune --unshallow 2> /dev/null || true
193-
echo "## Changelog" > changelog.txt
194-
echo "" >> changelog.txt
195-
git log --pretty=format:"- %s (%h) by %an" $(git rev-parse HEAD^)..HEAD >> changelog.txt
196-
echo "CHANGELOG=$(cat changelog.txt)" >> $GITHUB_OUTPUT
194+
echo "Generating changelog..."
195+
196+
# Ensure full history is available
197+
git fetch --prune --unshallow || true
198+
199+
# Generate changelog from the last 10 commits
200+
CHANGELOG=$(git log --pretty=format:"- %s (%h) by %an" -n 10 | sed 's/"/\\"/g' | tr -d '\r')
201+
202+
# Output the changelog for debugging
203+
echo "Changelog:"
204+
echo "$CHANGELOG"
205+
206+
# Store changelog in environment variable safely
207+
{
208+
echo 'CHANGELOG<<EOF'
209+
echo "$CHANGELOG"
210+
echo 'EOF'
211+
} >> "$GITHUB_ENV"
212+
213+
# Store changelog in GITHUB_OUTPUT so it can be used in later steps
214+
{
215+
echo 'CHANGELOG<<EOF'
216+
echo "$CHANGELOG"
217+
echo 'EOF'
218+
} >> "$GITHUB_OUTPUT"
197219
198220
- name: Upload Changelog as artifact
199221
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)