-
Notifications
You must be signed in to change notification settings - Fork 303
fix: The release of APK is fixed. #602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Release v3.0.0
Signed-off-by: uju09 <24bcs012@iiitdwd.ac.in>
This reverts commit 0cd58c7.
Signed-off-by: uju09 <24bcs012@iiitdwd.ac.in>
📝 WalkthroughWalkthroughAdded disk-usage checks and cleanup steps to the GitHub Actions workflow, wired CHANGELOG.md parsing to expose Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🎉 Welcome @uju09!
We appreciate your contribution! 🚀 |
|
@M4dhav I request you to review. |
|
Please follow the specified PR template and don't overwrite it in the future |
|
Please test the workflow locally and share a video |
M4dhav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for test video
|
@M4dhav Sorry for PR body. I forgot. |
|
@M4dhav I don't have secrets with me. Testing it locally is not possible. |
|
You can setup your own secrets locally on your fork |
|
Where to get secrets. I am in Web dev. I don't know much about App dev and its release. |
|
@M4dhav Can you test it on test branch. I request you. |
All of the secrets are self explanatory, and as this is for GitHub Release, you don't need credentials for an App Console account. You will be able to easily find where to generate which secret. |
I'm sorry, I do not have the time right now to do so |
|
@M4dhav Ok give me some time. I will try and share a video. |
|
@M4dhav I request you to test the workflow. |
Signed-off-by: uju09 <24bcs012@iiitdwd.ac.in>
Signed-off-by: uju09 <24bcs012@iiitdwd.ac.in>
|
@coderabbitai Review. |
|
@uju09: I'll review the changes in this PR for you. ✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/build_and_deploy.yml (1)
27-42: Approve disk housekeeping; consider pinning the action version.The disk space cleanup steps are well-placed and should resolve common CI/CD runner failures. The disk usage visibility aids debugging.
However, the
free-disk-space@mainaction is unpinned to a specific version. This can cause reproducibility issues if the action changes behavior in the future.Consider pinning to a specific version tag:
- uses: jlumbroso/free-disk-space@main + uses: jlumbroso/free-disk-space@v1.16.0You can check the latest stable version at https://github.com/jlumbroso/free-disk-space/releases.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build_and_deploy.yml(4 hunks)
🔇 Additional comments (2)
.github/workflows/build_and_deploy.yml (2)
58-65: Good placement and scope of build cleanup step.The cleanup step is well-positioned after Flutter setup but before artifact builds, and comprehensively removes Flutter, Gradle, and cache artifacts. This should eliminate stale build cache issues.
106-119: Verify APK artifact path resolution and MIME type update.The
APK_RELEASE_PATHenvironment variable and MIME type update appear correct:
- Path
apk-release/app-release.apkshould align with the upload structure (artifact name + filename)- MIME type
application/vnd.android.package-archiveis the standard type for Android packagesHowever, verification requires access to the workflow file's upload configuration (lines 94-98) to confirm that the artifact download on lines 110–112 places files in the expected
apk-release/directory so the path resolves correctly at release time. Specifically, verify that the upload step usesname: apk-releaseand that the fileapp-release.apkwill be in the correct nested directory after download.
| dotnet: true | ||
| haskell: true | ||
| large-packages: true | ||
| docker-images: true | ||
| swap-storage: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even have any of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no idea what we have, so I thought to give it a try, and also it is future proof to clear the disk storage.
Signed-off-by: uju09 <24bcs012@iiitdwd.ac.in>
|
@M4dhav Changes have been made. |
M4dhav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@M4dhav I think the name of file was wrong, I will fix it. |
Signed-off-by: uju09 <24bcs012@iiitdwd.ac.in>
|
@M4dhav There was a typo, Now it will succeed. |
M4dhav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: uju09 <24bcs012@iiitdwd.ac.in>
|
@M4dhav I am sorry for irritating. Due to consistent errors, I took suggestions from AI and my seniors and updated the release action version to latest. It is my fault, I would have checked earlier whether it is right or not. I apologize for that. Don't know why but this workflow is taking too much time, though it should not take, but it is giving trouble and all types of errors, so I was trying to analyse it from every angle. |
|
@M4dhav Now I think everything is fine... and it should do its job. |
It is alright. The workflow is working fine now. Could you make a few more modifications please? The Build Tag and Release Notes should be fetched from the Changelog |
Signed-off-by: uju09 <24bcs012@iiitdwd.ac.in>
|
@M4dhav Hey, I think we should write our CHANGELOG.md in order of latest version. Currently the latest version is at last, can we modify it , so it becomes easy for contributors and for job too for parsing. |
If that is the case, then sure, we can have it top to bottom. Please feel free to raise a PR for the same |
|
@M4dhav Ok then I will create an issue. Currently I am busy with my internship, I am will try to resolve all assigned issue as soon as possible. |
|
@M4dhav I have added the section that extracts release notes from CHANGELOG.md. I request you to review it. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/build_and_deploy.yml (1)
59-69: Clarify the step name to distinguish from earlier cleanup.The step "Show disk usage after cleanup" at line 68 has the same name as line 41-42, making logs harder to navigate. Since this displays disk state after Flutter/Gradle cleanup specifically, consider renaming it to "Show disk usage after Flutter cleanup" or similar.
🔎 Suggested rename
- - name: Show disk usage after cleanup + - name: Show disk usage after Flutter cleanup run: df -h /
Note on aggressive cleanup vs. build performance.
Removing all Gradle caches, daemon, and Android build-cache will force full rebuilds and significantly increase build time. This is appropriate for disk-constrained environments but consider whether partial cache retention could balance space and performance once the immediate disk issue is resolved.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build_and_deploy.yml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: M4dhav
Repo: AOSSIE-Org/Resonate PR: 510
File: .github/workflows/build_and_deploy.yml:31-36
Timestamp: 2025-08-31T16:18:53.594Z
Learning: For the AOSSIE-Org/Resonate project, build system requirements like Java version setup are considered separate from dependency update PRs and should be handled in dedicated PRs focused on build system improvements.
🔇 Additional comments (4)
.github/workflows/build_and_deploy.yml (4)
27-42: LGTM: Disk space management approach is sound.The before/after disk usage visibility combined with targeted cleanup is a good debugging and maintenance strategy. Correctly preserving Android SDK while clearing other resources.
110-111: LGTM: APK artifact path flow is consistent.The introduction of
APK_RELEASE_PATHwith the matching download directory and glob pattern creates a clean, maintainable artifact flow.Also applies to: 147-147, 153-153
113-114: LGTM: Checkout step is necessary for CHANGELOG access.Adding the repository checkout in the deploy job correctly enables the CHANGELOG parsing step that follows.
155-156: Dynamic release metadata from CHANGELOG is a good approach.Using parsed values from CHANGELOG.md for the tag and release body enables single-source-of-truth versioning. However, this relies on robust parsing with error handling (see comment on lines 116-141).
| - name: Parse Build Tag & Release Notes from CHANGELOG.md | ||
| id: parse_changelog | ||
| run: | | ||
| echo "Parsing CHANGELOG.md" | ||
| awk ' | ||
| BEGIN {found=0} | ||
| /^##[[:space:]]*\[?v?[0-9]+\.[0-9]+\.[0-9]+.*\]?/ && found==0 { | ||
| line=$0 | ||
| gsub(/^##[[:space:]]*/, "", line) | ||
| sub(/[[:space:]]+-[[:space:]]*.*$/, "", line) | ||
| gsub(/^\[|\]$/, "", line) | ||
| tag=line | ||
| if (tag !~ /^v/) tag = "v" tag | ||
| found=1 | ||
| next | ||
| } | ||
| found==1 { | ||
| if (/^##[[:space:]]+/) exit | ||
| notes = notes $0 "\n" | ||
| } | ||
| END { | ||
| printf("build_tag=%s\n", tag) | ||
| printf("release_notes<<EOF\n%s\nEOF\n", notes) | ||
| } | ||
| ' CHANGELOG.md >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, check if CHANGELOG.md exists and examine its format
git ls-files | grep -i changelogRepository: AOSSIE-Org/Resonate
Length of output: 45
🏁 Script executed:
# Also check the workflow file context around the snippet
find . -name "build_and_deploy.yml" -o -name "*.yml" -path "*workflows*"Repository: AOSSIE-Org/Resonate
Length of output: 316
🏁 Script executed:
# Check file size of build_and_deploy.yml
wc -l ./.github/workflows/build_and_deploy.ymlRepository: AOSSIE-Org/Resonate
Length of output: 107
🏁 Script executed:
# Read the workflow file around the snippet area (lines 100-150)
sed -n '100,150p' ./.github/workflows/build_and_deploy.ymlRepository: AOSSIE-Org/Resonate
Length of output: 1514
🏁 Script executed:
# Check if there are any changelog files with different names
find . -type f \( -name "*change*" -o -name "*CHANGE*" \) | head -20Repository: AOSSIE-Org/Resonate
Length of output: 316
🏁 Script executed:
# Check the entire repository for any changelog file
find . -type f -name "*[Cc][Hh][Aa][Nn][Gg]*" 2>/dev/nullRepository: AOSSIE-Org/Resonate
Length of output: 316
🏁 Script executed:
# Check if CHANGELOG.md exists in the root
ls -la CHANGELOG.md 2>&1Repository: AOSSIE-Org/Resonate
Length of output: 122
🏁 Script executed:
# Read the full workflow file to see all steps and understand the complete context
cat -n ./.github/workflows/build_and_deploy.ymlRepository: AOSSIE-Org/Resonate
Length of output: 5807
🏁 Script executed:
# Check if CHANGELOG.md exists in git history or other branches
git log --all --full-history --pretty=format:"%H %s" -- CHANGELOG.md 2>&1 | head -5Repository: AOSSIE-Org/Resonate
Length of output: 45
🏁 Script executed:
# Check all branches to see if CHANGELOG.md exists anywhere
git branch -a --format='%(refname:short)' | xargs -I {} sh -c 'git ls-tree -r {} -- CHANGELOG.md >/dev/null 2>&1 && echo "Found in: {}"'Repository: AOSSIE-Org/Resonate
Length of output: 205
🏁 Script executed:
# Let's trace what happens in the workflow if the file doesn't exist
# Simulate what awk does with a missing file
echo "Testing awk behavior with missing file:"
awk 'BEGIN {print "starting"}' /nonexistent/file 2>&1; echo "Exit code: $?"Repository: AOSSIE-Org/Resonate
Length of output: 124
🏁 Script executed:
# Check which branch we're on and if CHANGELOG.md exists there
git branch -vvRepository: AOSSIE-Org/Resonate
Length of output: 360
🏁 Script executed:
# Check git status
git statusRepository: AOSSIE-Org/Resonate
Length of output: 128
🏁 Script executed:
# Try to checkout or show CHANGELOG.md from master
git show master:CHANGELOG.md 2>&1 | head -30Repository: AOSSIE-Org/Resonate
Length of output: 116
🏁 Script executed:
# Check if CHANGELOG.md exists in the current branch (coderabbit_602)
cat CHANGELOG.md 2>&1 | head -50Repository: AOSSIE-Org/Resonate
Length of output: 107
🏁 Script executed:
# Also check the git log to understand the commit
git log --oneline -1Repository: AOSSIE-Org/Resonate
Length of output: 129
🏁 Script executed:
# Show what files were changed in the current commit/branch
git diff --name-only coderabbit_602...master 2>/dev/null | grep -i changeRepository: AOSSIE-Org/Resonate
Length of output: 45
🏁 Script executed:
# Check the current commit to see what was changed
git show --stat HEADRepository: AOSSIE-Org/Resonate
Length of output: 24217
🏁 Script executed:
# List all files in the current directory to see what exists
ls -laRepository: AOSSIE-Org/Resonate
Length of output: 1900
🏁 Script executed:
# Check if CHANGELOG.md was added in this commit
git show HEAD --name-status | head -20Repository: AOSSIE-Org/Resonate
Length of output: 835
🏁 Script executed:
# Check if there's a git tag or version info in any other file
grep -r "version" . --include="*.yaml" --include="*.yml" --include="*.md" 2>/dev/null | grep -i "changelog\|release\|version" | head -20Repository: AOSSIE-Org/Resonate
Length of output: 7110
🏁 Script executed:
# Simulate what happens with the awk script when CHANGELOG.md doesn't exist
# and check what gets output to GITHUB_OUTPUT
cat > /tmp/test_awk.sh << 'EOF'
#!/bin/bash
# Create a fake GITHUB_OUTPUT
GITHUB_OUTPUT=/tmp/github_output.txt
rm -f $GITHUB_OUTPUT
# Run the exact awk command from the workflow (without the file)
awk '
BEGIN {found=0}
/^##[[:space:]]*\[?v?[0-9]+\.[0-9]+\.[0-9]+.*\]?/ && found==0 {
line=$0
gsub(/^##[[:space:]]*/, "", line)
sub(/[[:space:]]+-[[:space:]]*.*$/, "", line)
gsub(/^\[|\]$/, "", line)
tag=line
if (tag !~ /^v/) tag = "v" tag
found=1
next
}
found==1 {
if (/^##[[:space:]]+/) exit
notes = notes $0 "\n"
}
END {
printf("build_tag=%s\n", tag)
printf("release_notes<<EOF\n%s\nEOF\n", notes)
}
' /nonexistent/CHANGELOG.md >> $GITHUB_OUTPUT 2>&1
echo "Exit code: $?"
echo ""
echo "=== Content of GITHUB_OUTPUT ==="
cat $GITHUB_OUTPUT
echo ""
echo "=== Checking if tag is empty ==="
TAG=$(grep "build_tag=" $GITHUB_OUTPUT | cut -d'=' -f2)
if [ -z "$TAG" ]; then
echo "ERROR: build_tag is empty!"
elif [ "$TAG" = "v" ]; then
echo "ERROR: build_tag is just 'v' with no version!"
else
echo "build_tag=$TAG"
fi
EOF
bash /tmp/test_awk.shRepository: AOSSIE-Org/Resonate
Length of output: 279
🏁 Script executed:
# Check the ncipollo/release-action documentation to see what happens with empty tag
# First, check if there are any test files or documentation in the repo about release
find . -name "*.md" -type f | xargs grep -l "release-action\|ncipollo" 2>/dev/nullRepository: AOSSIE-Org/Resonate
Length of output: 47
🏁 Script executed:
# Search for documentation or PRs related to the workflow
git log --all --oneline | grep -i "changelog\|release" | head -10Repository: AOSSIE-Org/Resonate
Length of output: 723
🏁 Script executed:
# Check if there's a way to see what the release action does with empty tag
# Look at the full workflow again to see if there's any conditional logic
sed -n '149,156p' ./.github/workflows/build_and_deploy.ymlRepository: AOSSIE-Org/Resonate
Length of output: 403
🏁 Script executed:
# Let's verify the exact behavior: does awk exit with error when file missing?
echo "Testing awk exit behavior:"
awk 'BEGIN {print "test"}' /nonexistent/file >> /tmp/out.txt 2>&1
echo "AWK exit code when file missing: $?"
cat /tmp/out.txt
echo ""
echo "Checking if workflow would continue:"
set +e # Don't exit on error
awk 'BEGIN {print "test"}' /nonexistent/file >> /tmp/out2.txt 2>&1
if [ $? -ne 0 ]; then
echo "awk failed, but if set -e is not used, bash continues"
fiRepository: AOSSIE-Org/Resonate
Length of output: 167
🏁 Script executed:
# This is critical - the workflow was added but CHANGELOG.md doesn't exist
# Let me check if the commit that added the workflow also added CHANGELOG.md
git show 1d5d5ee --name-status | grep -i changelogRepository: AOSSIE-Org/Resonate
Length of output: 125
🏁 Script executed:
# Check if CHANGELOG.md was supposed to be in the commit
git show 1d5d5ee | grep -i "changelog" | head -20Repository: AOSSIE-Org/Resonate
Length of output: 433
🏁 Script executed:
# Search the entire git history for any CHANGELOG file
git log --all --full-history --diff-filter=A --name-only --pretty=format: -- "*CHANGELOG*" | grep -v "^$"Repository: AOSSIE-Org/Resonate
Length of output: 45
🏁 Script executed:
# Let's also verify: what happens when the release-action gets an empty or missing tag?
# Check ncipollo/release-action documentation or comments in the workflow
grep -A5 -B5 "ncipollo/release-action" ./.github/workflows/build_and_deploy.ymlRepository: AOSSIE-Org/Resonate
Length of output: 408
🏁 Script executed:
# Check if there are any other branches or recent changes that might have added CHANGELOG.md
git branch -a | xargs -I {} sh -c 'echo "=== Branch: {} ===" && git ls-tree -r {} -- CHANGELOG.md 2>/dev/null | head -1 || echo "Not found"'Repository: AOSSIE-Org/Resonate
Length of output: 320
🏁 Script executed:
# Check the commit history around this workflow addition
git log --oneline --all -- ".github/workflows/build_and_deploy.yml" | head -10Repository: AOSSIE-Org/Resonate
Length of output: 430
🏁 Script executed:
# Verify: what actually happens in the workflow when build_tag is empty
# Simulate the exact sequence in the workflow
cat > /tmp/simulate_workflow.sh << 'EOF'
#!/bin/bash
set +e
GITHUB_OUTPUT=/tmp/test_output.txt
rm -f $GITHUB_OUTPUT
echo "Step 1: Parse CHANGELOG.md (file doesn't exist)"
awk '
BEGIN {found=0}
/^##[[:space:]]*\[?v?[0-9]+\.[0-9]+\.[0-9]+.*\]?/ && found==0 {
line=$0
gsub(/^##[[:space:]]*/, "", line)
sub(/[[:space:]]+-[[:space:]]*.*$/, "", line)
gsub(/^\[|\]$/, "", line)
tag=line
if (tag !~ /^v/) tag = "v" tag
found=1
next
}
found==1 {
if (/^##[[:space:]]+/) exit
notes = notes $0 "\n"
}
END {
printf("build_tag=%s\n", tag)
printf("release_notes<<EOF\n%s\nEOF\n", notes)
}
' CHANGELOG.md >> $GITHUB_OUTPUT 2>&1
PARSE_EXIT=$?
echo "AWK exit code: $PARSE_EXIT"
echo ""
echo "Step 2: Extract build_tag value"
BUILD_TAG=$(grep "^build_tag=" $GITHUB_OUTPUT 2>/dev/null | cut -d'=' -f2)
echo "BUILD_TAG value: '$BUILD_TAG'"
echo ""
echo "Step 3: What would be passed to release-action"
echo "Tag parameter: '$BUILD_TAG'"
if [ -z "$BUILD_TAG" ]; then
echo "⚠️ ISSUE: Tag is empty - release-action will fail or use default tag"
fi
echo ""
echo "Full GITHUB_OUTPUT content:"
cat $GITHUB_OUTPUT
EOF
bash /tmp/simulate_workflow.shRepository: AOSSIE-Org/Resonate
Length of output: 441
🏁 Script executed:
# Final check: was CHANGELOG.md supposed to be created but forgotten?
# Look at the commit message and diff more carefully
git show 1d5d5ee | grep -A3 -B3 "CHANGELOG" || echo "No CHANGELOG mentioned in commit details"Repository: AOSSIE-Org/Resonate
Length of output: 783
CHANGELOG.md is missing from the repository – workflow cannot function.
The AWK parsing step will fail immediately because the file doesn't exist. When awk tries to read CHANGELOG.md, it returns exit code 2 with error: cannot open file 'CHANGELOG.md' for reading: No such file or directory. This leaves build_tag as an empty string, which is then passed to the release-action, causing the release step to fail.
Two fixes are required:
- Create CHANGELOG.md in the repository root with version entries matching the regex pattern:
## [v]X.Y.Z - Add error handling to validate file existence and non-empty parsed values before proceeding to the release step
🤖 Prompt for AI Agents
.github/workflows/build_and_deploy.yml around lines 116-141: the workflow
assumes CHANGELOG.md exists and AWK will fail (exit code 2) if the file is
missing, leaving build_tag empty and breaking the release step; fix by (1)
adding a CHANGELOG.md at the repository root with entries matching the expected
header pattern (## [v]X.Y.Z) so the parser has data, and (2) adding workflow
error handling before the release-action to check that CHANGELOG.md exists and
that parsed outputs (build_tag and release_notes) are non-empty — if the file is
missing or parsing yields empty values, fail fast with a clear error message (or
skip release) so the release step is not invoked with empty inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore this, the changelog file exists. Review the rest of the code, specifically the parsing step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
echo "=== Checking CHANGELOG.md existence and format ==="
if [ -f CHANGELOG.md ]; then
echo "✓ CHANGELOG.md exists"
echo ""
echo "=== First 50 lines of CHANGELOG.md ==="
head -n 50 CHANGELOG.md
echo ""
echo "=== All version headers found ==="
grep -n "^##" CHANGELOG.md | head -20
else
echo "✗ CHANGELOG.md not found"
exit 1
fi
echo ""
echo "=== Testing the AWK parsing script ==="
GITHUB_OUTPUT=/tmp/test_github_output.txt
rm -f $GITHUB_OUTPUT
awk '
BEGIN {found=0}
/^##[[:space:]]*\[?v?[0-9]+\.[0-9]+\.[0-9]+.*\]?/ && found==0 {
line=$0
gsub(/^##[[:space:]]*/, "", line)
sub(/[[:space:]]+-[[:space:]]*.*$/, "", line)
gsub(/^\[|\]$/, "", line)
tag=line
if (tag !~ /^v/) tag = "v" tag
found=1
next
}
found==1 {
if (/^##[[:space:]]+/) exit
notes = notes $0 "\n"
}
END {
printf("build_tag=%s\n", tag)
printf("release_notes<<EOF\n%s\nEOF\n", notes)
}
' CHANGELOG.md > $GITHUB_OUTPUT
echo "Exit code: $?"
echo ""
echo "=== Parsed output ==="
cat $GITHUB_OUTPUT
echo ""
echo "=== Extracted values ==="
echo "build_tag: $(grep "^build_tag=" $GITHUB_OUTPUT | cut -d'=' -f2)"
echo ""
echo "release_notes (first 300 chars):"
sed -n '/release_notes<<EOF/,/^EOF$/p' $GITHUB_OUTPUT | head -n 15
Length of output: 75
🏁 Script executed:
#!/bin/bash
echo "=== Checking for CHANGELOG.md in different locations ==="
# Check if file exists on master branch
echo "1. Checking master branch:"
git ls-tree -r master --name-only | grep -i changelog
echo ""
echo "2. Checking dev branch:"
git ls-tree -r dev --name-only | grep -i changelog
echo ""
echo "3. Checking current branch:"
git ls-tree -r HEAD --name-only | grep -i changelog
echo ""
echo "4. Finding any changelog-like files in repo:"
find . -type f -iname "*change*" 2>/dev/null | grep -v ".git"
echo ""
echo "5. Checking if CHANGELOG.md exists on master:"
git show master:CHANGELOG.md 2>&1 | head -n 50
echo ""
echo "6. Current branch name:"
git branch --show-current
Length of output: 563
@M4dhav, I'll focus on the AWK parsing logic as requested.
Critical Issue: Regex Inconsistency
The AWK script has a regex pattern mismatch that will cause incorrect parsing:
Line 122 (version header matching):
/^##[[:space:]]*\[?v?[0-9]+\.[0-9]+\.[0-9]+.*\]?/Uses [[:space:]]* — allows zero or more spaces after ##
Line 130 (exit condition for notes):
if (/^##[[:space:]]+/) exitUses [[:space:]]+ — requires one or more spaces after ##
Impact
If CHANGELOG.md contains headers without spaces (e.g., ##Features, ##[2.0.0], ##Fixes), the script will:
- ✅ Correctly match version header like
##v1.0.0 - ❌ Fail to stop at
##Featuresbecause it has zero spaces - ❌ Include subsequent headers and content in
release_notes
Recommended Fix
Make the patterns consistent:
# Option 1: Both require at least one space
/^##[[:space:]]+\[?v?[0-9]+\.[0-9]+\.[0-9]+.*\]?/ # Line 122
if (/^##[[:space:]]+/) exit # Line 130 (unchanged)
# Option 2: Both allow zero or more spaces (safer for varied formats)
/^##[[:space:]]*\[?v?[0-9]+\.[0-9]+\.[0-9]+.*\]?/ # Line 122 (unchanged)
if (/^##[[:space:]]*/) exit # Line 130 (change to *)Recommendation: Use Option 2 to handle various CHANGELOG formats robustly.
Additional Issues
-
No validation for empty tag: If no version is found,
tagremains empty, outputtingbuild_tag=v(just the prefix). Add validation in the END block:END { if (tag == "") { print "ERROR: No version found in CHANGELOG.md" > "/dev/stderr" exit 1 } printf("build_tag=%s\n", tag) printf("release_notes<<EOF\n%s\nEOF\n", notes) }
-
Trailing newline in notes: Each line appends
\n, resulting in an extra trailing newline. While not critical, you could trim it:END { sub(/\n$/, "", notes) # Remove final trailing newline printf("build_tag=%s\n", tag) printf("release_notes<<EOF\n%s\nEOF\n", notes) }
Would you like me to provide the complete corrected AWK script?
🧠 Learnings used
Learnt from: M4dhav
Repo: AOSSIE-Org/Resonate PR: 510
File: .github/workflows/build_and_deploy.yml:31-36
Timestamp: 2025-08-31T16:18:53.594Z
Learning: For the AOSSIE-Org/Resonate project, build system requirements like Java version setup are considered separate from dependency update PRs and should be handled in dedicated PRs focused on build system improvements.
|
@M4dhav The CHANGELOG.md doesn't yet exist on master branch, coderabbit is hallucinating. |
|
Thank you for the contribution, great work. I tested this on my local and it works fine. |
|
✅ PR Closed - Thank You, @uju09!
We appreciate your effort and look forward to more contributions from you! 🤝 |




Description
This PR fixes the broken release job of Build and Deploy workflow.
Fixes #539
Type of change
Checklist:
Maintainer Checklist
github_workflowSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.