Skip to content

Conversation

@mac-anysphere
Copy link

@mac-anysphere mac-anysphere commented Oct 31, 2025

This PR adds a new use_aptfile input parameter that allows users to disable reading packages from the Aptfile, even if one exists in the repository.

Changes

  • Added use_aptfile input parameter (defaults to true for backward compatibility)
  • Updated pre_cache_action.sh to check the flag before reading Aptfile
  • Updated README.md with documentation and examples

Motivation

Some users may want to use only the packages input parameter and ignore any Aptfile that exists in their repository. This option provides that flexibility.

Testing

  • Default behavior (use_aptfile: true) maintains backward compatibility
  • Setting use_aptfile: false disables Aptfile reading as expected

Note

Adds Aptfile-based package sourcing (merge with input), a use_aptfile toggle, makes packages optional, and persists the normalized package list for restore; docs updated with examples.

  • Action inputs (action.yml):
    • Make inputs.packages optional; add inputs.use_aptfile (default true).
    • Pass use_aptfile to pre_cache_action.sh and wire env vars accordingly.
  • Pre-cache script (pre_cache_action.sh):
    • Add Aptfile parsing/merging logic controlled by use_aptfile.
    • Normalize combined packages; improve empty-packages handling messages.
    • Persist normalized packages to ${cache_dir}/packages.txt and quote writes.
    • Include repo list in cache key; minor validation/quoting tweaks.
  • Post-cache script (post_cache_action.sh):
    • Read packages from ${cache_dir}/packages.txt if present; fallback to input.
  • Library (lib.sh):
    • Add parse_aptfile utility to extract packages from Aptfile.
  • Docs (README.md):
    • Document Aptfile support, merging behavior, use_aptfile flag, and examples (Aptfile-only, combined, disabling).

Written by Cursor Bugbot for commit 32569df. This will update automatically on new commits. Configure here.

@mac-anysphere mac-anysphere changed the title Add option to disable Aptfile usage Add Aptfile support Oct 31, 2025
fi
elif test -z "${GITHUB_WORKSPACE}"; then
log "GITHUB_WORKSPACE not set, skipping Aptfile check"
else
Copy link

Choose a reason for hiding this comment

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

Bug: Aptfile Fallback Fails Without GitHub Workspace (Logic bug)

When GITHUB_WORKSPACE is unset, the code explicitly skips checking for Aptfile even though aptfile_path was set to use '.' as a fallback. This contradicts the intended fallback and prevents Aptfile usage during local runs or environments without GITHUB_WORKSPACE, despite having a valid Aptfile in the current directory.

Fix in Cursor Fix in Web

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.

1 participant