File Permissions Error Encounter After New Theme Installed

My Website currently is hosted on DigitalOcean (One-click app) with Github Action to trigger latest version of Ghost Theme to website, everything is running smoothly like butter.

Just something annoying me is that, after new change deployed via Github Action, CLI ghost update will occurred below error :
sudo find ./ ! -path "./versions/*" -type f -exec chmod 664 {} \;

I can be easily resolved pasting the captioned commend, but I would like to know is there any better solution to solve it.

The command you shared is not an error message, it’s a solution to fix an error. Without knowing what the error is, it’s hard to provide advice to avoid it from happening.

This the issue I encountered

+ sudo systemctl is-active ghost_ghost
✔ Checking system Node.js version - found v16.19.0
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✖ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking free space
One or more errors occurred.

1) Checking file permissions

Message: Your installation folder contains some directories or files with incorrect permissions:
- ./content/themes/ruby/assets/images/default-skin.svg
- ./content/themes/ruby/assets/images/default-skin.png
- ./content/themes/ruby/assets/images/preloader.gif
Run sudo find ./ ! -path "./versions/*" -type f -exec chmod 664 {} \; and try again.

Debug Information:
    OS: Ubuntu, v22.04.1 LTS
    Node Version: v16.19.0
    Ghost Version: 5.26.4
    Ghost-CLI Version: 1.23.1
    Environment: production
    Command: 'ghost update'

Try running ghost doctor to check your system for known issues.

Here’s my guess:

tar files that contain themes can also preserve permissions. Maybe there’s a way to construct the tar file so it ignores permissions or have different/correct ones.

I have run into the same situation myself from time to time and so far have always just run the sudo command and gone with with life-- but you are right: maybe there’s a better way to solve it.