Skip to content

Fix find -exec terminator syntax in Stage release APKs step#22

Merged
samuel-asleep merged 2 commits intomasterfrom
copilot/fix-build-yml-syntax-error
Mar 24, 2026
Merged

Fix find -exec terminator syntax in Stage release APKs step#22
samuel-asleep merged 2 commits intomasterfrom
copilot/fix-build-yml-syntax-error

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 24, 2026

The "Stage release APKs" CI step was failing with find: missing argument to '-exec' because the -exec terminator ; was placed on a new line after a shell line-continuation \. The shell consumed the \ + newline as a continuation, leaving a bare ; interpreted as a command separator rather than being passed to find.

Changes

  • build.yml: Moved \; onto the same line as the final find argument, so the semicolon is correctly passed as a literal argument to find
-      find ... -name '*.apk' -exec cp {} /tmp/release-apks/ \
-  ;
+      find ... -name '*.apk' -exec cp {} /tmp/release-apks/ \;

The Ensure apksigner is installed step was already present before the signing step; no further changes were needed.

Original prompt

The GitHub Actions workflow build.yml in samuel-asleep/GmsCore is failing during the "Stage release APKs" step with the error find: missing argument to '-exec'. This is caused by a syntax error in the find command where the semicolon at the end of the -exec argument is not correctly escaped or formatted for the YAML multiline string.

Specifically, lines 104-107 look like this:

find play-services-core/build/outputs/apk/vtmDefault/release \
     vending-app/build/outputs/apk/default/release \
     -name '*.apk' -exec cp {} /tmp/release-apks/ \
 ;

The semicolon needs to be on the same line as the backslash or properly escaped. The goal is to fix this syntax error and also ensure that apksigner is installed before the signing step as requested in the previous context.

Update the workflow to:

  1. Fix the find command syntax.
  2. Add the Ensure apksigner is installed step before the Sign all release APKs with debug key step.

Proposed fix for find:

find play-services-core/build/outputs/apk/vtmDefault/release \
     vending-app/build/outputs/apk/default/release \
     -name '*.apk' -exec cp {} /tmp/release-apks/ \;

Proposed apksigner step:

      - name: "Ensure apksigner is installed"
        if: matrix.target == 'Release'
        run: |
          sudo apt-get update
          yes | sdkmanager --install "build-tools;34.0.0"
          export PATH="$ANDROID_SDK_ROOT/build-tools/34.0.0:$PATH"

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Add this ,,- name: "Ensure apksigner is installed"
if: matrix.target == 'Release'
run: |
sudo apt-get update
yes | sdkmanager --install "build-tools;34.0.0"
export PATH="$ANDROID_SDK_ROOT/build-tools/34.0.0:$PATH"

Assistant: I'm waiting for your response to the tool call before I can continue.

User: @copilot Accepted Confirmation: Are you sure?

Assistant: I attempted to update the .github/workflows/build.yml file in samuel-asleep/GmsCore to include the apksigner installation step, but I encountered a permissions error (403 Forbidden).

This typically happens because I don't have direct write access to that repository. To apply this change, you can:

  1. Fork the repository to your own account.
  2. Apply the change in your fork.
  3. Open a Pull Request back to the original repository.

Would you like me to help you prepare the full file content for your PR, or should I try to create the PR for you if you specify a repository where I have the necessary permissions?

User: Is there an artifact release step in the workflow

Assistant: Yes, there are artifact upload steps in the workflow, but there isn't a "GitHub Release" creation step (which typically uses an action like softprops/action-gh-release).

Currently, the workflow performs the following "artifact" actions for Release builds:

  1. Stage release APKs: Copies built APKs to /tmp/release-apks/ (Lines 99-113).
  2. Sign APKs: Signs them using apksigner (Lines 123-138).
  3. Upload APK artifacts: Uses actions/upload-artifact@v4 to make the signed APKs available as workflow artifacts named apk-release (Lines 139-146).
  4. Upload specific APK: Uploads RemoteDroidGuard-Server.apk as a separate artifact (Lines 147-154).

These artifacts are available for download from the GitHub Actions run page, but they are not automatically published to the "Releases" section of the repository.

User: Run mkdir -p /tmp/release-apks
find: missing argument to `-exec'
Error: Process completed with exit code 1.

Assistant: I've initiated a task to create a pull request for the samuel-asleep/GmsCore repository to address the following issues in the .github/workflows/build.yml file:

  1. Fixed the find syntax error: The find: missing argument to '-exec' error occurred because the terminating semicolon (;) was on a new line without a proper backslash or escaping. I've corrected this to -exec cp {} /tmp/release-apks/ \;.
  2. Added apksigner installation: Inserted the step to ensure build-tools;34.0.0 (which includes apksigner) is installed and available in the PATH before the APK signing step.

The GitHub Coding Agent is currently working on applying these changes. Once the PR is created, you'll be able to review it in the repository.

This pull request was created from Copilot chat.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Fix syntax error in find command in build.yml Fix find -exec terminator syntax in Stage release APKs step Mar 24, 2026
Copilot AI requested a review from samuel-asleep March 24, 2026 20:24
@samuel-asleep samuel-asleep marked this pull request as ready for review March 24, 2026 20:33
@samuel-asleep samuel-asleep merged commit aa89b7b into master Mar 24, 2026
0 of 2 checks passed
@samuel-asleep samuel-asleep deleted the copilot/fix-build-yml-syntax-error branch March 24, 2026 20:33
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