Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check out the repo
uses: actions/checkout@v2
Comment on lines +10 to +11
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

actions/checkout@v2 is deprecated – switch back to v4 (or at least v3).

The action-lint warning is correct; v2 runs on the old Node 12 runtime and will stop receiving updates. Unless there is a hard blocker, stay on the maintained major:

-      uses: actions/checkout@v2
+      uses: actions/checkout@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Check out the repo
uses: actions/checkout@v2
- name: Check out the repo
uses: actions/checkout@v4
🧰 Tools
🪛 actionlint (1.7.7)

11-11: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/linter.yml at lines 10 to 11, the GitHub action uses the
deprecated actions/checkout@v2 version. Update the uses field to
actions/checkout@v4 to ensure compatibility with the latest Node runtime and
continued support.

with:
fetch-depth: 2

- name: Configure Git Safe Directory
run: git config --global --add safe.directory /app

Comment on lines +15 to +17
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

git config --global … /app runs on the host, not inside the container.

The safe-directory warning you are trying to silence originates inside the Docker container, so this step doesn’t help. Two options:

  1. Run the config command inside the container before composer install.
  2. Add -e GIT_CONFIG_GLOBAL=/tmp/gitconfig + git config --global --add safe.directory /app in the docker run.

If the warning isn’t fatal, consider removing the step altogether.

🤖 Prompt for AI Agents
In .github/workflows/linter.yml around lines 15 to 17, the git config command to
add /app as a safe directory is running on the host instead of inside the Docker
container, so it does not suppress the warning. To fix this, either move the git
config command to run inside the container before the composer install step or
modify the docker run command to include the environment variable
GIT_CONFIG_GLOBAL=/tmp/gitconfig and run git config --global --add
safe.directory /app inside the container. Alternatively, if the warning is not
critical, you can remove this step entirely.

- run: git checkout HEAD^2

- name: Run Linter
run: |
docker run --rm -v $PWD:/app composer sh -c \
"composer install --profile --ignore-platform-reqs && composer lint"
"composer install --profile --ignore-platform-reqs && composer lint"
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,32 @@
"name": "utopia-php/image",
"description": "A simple Image manipulation library",
"type": "library",
"version": "2.7.9",
"keywords": ["php","framework","upf","utopia","image"],
"license": "MIT",
"autoload": {
"psr-4": {"Utopia\\Image\\":"src/Image"}
},

"scripts": {
"lint": "./vendor/bin/pint --test",
"format": "./vendor/bin/pint",
"check": "./vendor/bin/phpstan analyse --level max src tests",
"test": "phpunit"
},

"require": {
"php": ">=8.1",
"ext-imagick": "*",
"ext-gd": "*"
},

"require-dev": {
"phpunit/phpunit": "^9.3",
"vimeo/psalm": "4.13.1",
"phpstan/phpstan": "^1.10.0",
"laravel/pint": "1.2.*"
},

"minimum-stability": "dev"
}
6 changes: 6 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"preset": "psr12",
"exclude": [
"tests/resources"
]
}