Skip to content

Conversation

@graycreate
Copy link
Member

Summary

  • Fixed the release pipeline failure that was preventing Play Store uploads
  • The pipeline was failing with error: /tmp/release_functions.sh: No such file or directory

Root Cause

The Play Store upload job was trying to source /tmp/release_functions.sh which was created in a different job (Create GitHub Release). Since GitHub Actions jobs run in isolated environments, files created in one job are not available in another job.

Solution

Duplicated the function definitions (categorize_commit and get_github_username) directly in the Play Store upload job's "Create whatsnew directory" step to ensure the required functions are available.

Testing

This fix ensures the release pipeline will complete successfully and upload the APK to Google Play Store.

🤖 Generated with Claude Code

The release pipeline was failing because the Play Store upload job tried to source
/tmp/release_functions.sh which was created in a different job. Since GitHub Actions
jobs run in isolated environments, files from one job aren't available in another.

This fix duplicates the function definitions directly in the Play Store upload job
to ensure the required functions are available.
Copilot AI review requested due to automatic review settings September 20, 2025 04:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a critical release pipeline failure that was preventing the V2er Android app from uploading to the Play Store. The issue was caused by a missing function definitions file that was expected to be available across different GitHub Actions jobs.

Key changes:

  • Duplicated function definitions directly in the Play Store upload job to resolve cross-job file availability issues
  • Added the categorize_commit and get_github_username functions inline to eliminate dependency on external file

Comment on lines +615 to +686
# Define shared functions (duplicated from release job since jobs run in isolation)
cat > /tmp/release_functions.sh << 'FUNCTIONS_EOF'
# Function to categorize commit message
categorize_commit() {
local msg="$1"
local category=""
local cleaned_msg=""
if [[ "$msg" =~ ^fix(\(.*\))?:\ (.*)$ ]] || [[ "$msg" =~ ^fix\ (.*)$ ]]; then
category="bug"
cleaned_msg="${BASH_REMATCH[-1]}"
elif [[ "$msg" =~ ^feat(\(.*\))?:\ (.*)$ ]] || [[ "$msg" =~ ^feat\ (.*)$ ]]; then
category="feature"
cleaned_msg="${BASH_REMATCH[-1]}"
elif [[ "$msg" =~ ^perf(\(.*\))?:\ (.*)$ ]]; then
category="performance"
cleaned_msg="${BASH_REMATCH[2]}"
elif [[ "$msg" =~ ^refactor(\(.*\))?:\ (.*)$ ]]; then
category="improvement"
cleaned_msg="${BASH_REMATCH[2]}"
elif [[ "$msg" =~ ^chore(\(.*\))?:\ (.*)$ ]]; then
category="maintenance"
cleaned_msg="${BASH_REMATCH[2]}"
elif [[ "$msg" =~ ^docs(\(.*\))?:\ (.*)$ ]]; then
category="documentation"
cleaned_msg="${BASH_REMATCH[2]}"
else
category="other"
cleaned_msg="$msg"
fi
# Remove PR numbers from the end
cleaned_msg=$(echo "$cleaned_msg" | sed 's/ (#[0-9]*)//')
# Capitalize first letter
cleaned_msg="$(echo "${cleaned_msg:0:1}" | tr '[:lower:]' '[:upper:]')${cleaned_msg:1}"
echo "$category:$cleaned_msg"
}
# Function to get GitHub username from commit
get_github_username() {
local commit_sha="$1"
local github_repo="${GITHUB_REPOSITORY}"
# Try to get the GitHub username from the commit using gh api
local username=$(gh api "repos/${github_repo}/commits/${commit_sha}" --jq '.author.login // empty' 2>/dev/null || echo "")
if [ -n "$username" ]; then
echo "@$username"
else
# Fallback: try to get committer login if author login is not available
local committer=$(gh api "repos/${github_repo}/commits/${commit_sha}" --jq '.committer.login // empty' 2>/dev/null || echo "")
if [ -n "$committer" ]; then
echo "@$committer"
else
# Last resort: use hardcoded mapping for known authors
local git_author=$(git show -s --format='%an' $commit_sha)
case "$git_author" in
"Gray Zhang" | "gray" | "Gray")
echo "@graycreate"
;;
"github-actions[bot]")
echo "@github-actions[bot]"
;;
*)
# If no mapping found, use git author name without @
echo "$git_author"
;;
esac
fi
fi
}
FUNCTIONS_EOF
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates a significant amount of code (70+ lines) that appears to exist elsewhere in the workflow. Consider using GitHub Actions artifacts or a shared script file to avoid code duplication and reduce maintenance burden.

Copilot uses AI. Check for mistakes.
Comment on lines +625 to +628
cleaned_msg="${BASH_REMATCH[-1]}"
elif [[ "$msg" =~ ^feat(\(.*\))?:\ (.*)$ ]] || [[ "$msg" =~ ^feat\ (.*)$ ]]; then
category="feature"
cleaned_msg="${BASH_REMATCH[-1]}"
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent BASH_REMATCH array indexing. Lines 625 and 628 use [-1] while lines 631, 634, 637, and 640 use [2]. This could lead to incorrect message extraction for different commit types.

Suggested change
cleaned_msg="${BASH_REMATCH[-1]}"
elif [[ "$msg" =~ ^feat(\(.*\))?:\ (.*)$ ]] || [[ "$msg" =~ ^feat\ (.*)$ ]]; then
category="feature"
cleaned_msg="${BASH_REMATCH[-1]}"
cleaned_msg="${BASH_REMATCH[2]}"
elif [[ "$msg" =~ ^feat(\(.*\))?:\ (.*)$ ]] || [[ "$msg" =~ ^feat\ (.*)$ ]]; then
category="feature"
cleaned_msg="${BASH_REMATCH[2]}"

Copilot uses AI. Check for mistakes.
Comment on lines +625 to +628
cleaned_msg="${BASH_REMATCH[-1]}"
elif [[ "$msg" =~ ^feat(\(.*\))?:\ (.*)$ ]] || [[ "$msg" =~ ^feat\ (.*)$ ]]; then
category="feature"
cleaned_msg="${BASH_REMATCH[-1]}"
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent BASH_REMATCH array indexing. Lines 625 and 628 use [-1] while lines 631, 634, 637, and 640 use [2]. This could lead to incorrect message extraction for different commit types.

Suggested change
cleaned_msg="${BASH_REMATCH[-1]}"
elif [[ "$msg" =~ ^feat(\(.*\))?:\ (.*)$ ]] || [[ "$msg" =~ ^feat\ (.*)$ ]]; then
category="feature"
cleaned_msg="${BASH_REMATCH[-1]}"
if [[ -n "${BASH_REMATCH[2]}" ]]; then
cleaned_msg="${BASH_REMATCH[2]}"
else
cleaned_msg="${BASH_REMATCH[1]}"
fi
elif [[ "$msg" =~ ^feat(\(.*\))?:\ (.*)$ ]] || [[ "$msg" =~ ^feat\ (.*)$ ]]; then
category="feature"
if [[ -n "${BASH_REMATCH[2]}" ]]; then
cleaned_msg="${BASH_REMATCH[2]}"
else
cleaned_msg="${BASH_REMATCH[1]}"
fi

Copilot uses AI. Check for mistakes.
@graycreate graycreate merged commit 03ef207 into main Sep 20, 2025
5 checks passed
@graycreate graycreate deleted the bugfix/release-pipeline-functions-missing branch September 20, 2025 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants