Error on install dependencies
I would like to use this action, this is the step
- name: Install dependencies
uses: php-actions/composer@master
with:
command: install
dev: no
args: --profile --ignore-platform-req
I always got this error:
Building PHP latest with extensions: ...
/usr/local/bin/docker-php-entrypoint: exec: line 9: composer: Permission denied
Same here, with @ v6 and @ master branch. :-(
Environment:
- Forgejo 7.0.2-linux-amd64
- Image: ghcr.io/catthehacker/ubuntu:act-latest (sha256:abfa2e1971b23fee51935eaf784863041846235c93318ff0f9cdff721fef5bc7)
Similar with v6 in Gitea
🚀 Start image=gitea/runner-images:ubuntu-latest
🐳 docker pull image=gitea/runner-images:ubuntu-latest platform= username= forcePull=true
🐳 docker pull gitea/runner-images:ubuntu-latest
pulling image 'docker.io/gitea/runner-images:ubuntu-latest' ()
Pulling from gitea/runner-images :: ubuntu-latest
Digest: sha256:3610750b0bfe9f6fa5f5e910cf3fc20208623fd1992413f1bfc63b2d93ec775d ::
Can anyone help me reproduce this issue? I use this action every day in my projects, and have no issues with permissions... but I run it within a normal Github Actions workflow - and I think you're using it elsewhere? Can you help me understand, so I can reproduce it myself?
I trying to use in Gitea and getting the same error. Steps:
- Setup Gitea self-hosted with an action runner (Gitea docs) (To get the REGISTRATION_TOKEN, you need to start Gitea service and go to: Admin Settings -> Actions -> Runners -> Create new Runner (after that you can update the docker-compose.yml to add the token and restart/recreate runner service))
services:
gitea:
image: docker.io/gitea/gitea:1.22.6
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=100
restart: unless-stopped
volumes:
- ./gitea/data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
runner:
image: docker.io/gitea/act_runner:nightly
container_name: gitea_runner
environment:
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
depends_on:
- gitea
restart: unless-stopped
volumes:
- ./gitea/runner:/data
- /var/run/docker.sock:/var/run/docker.sock
- create any repository with PHP code (in my case is an application using Laravel)
- add file
.gitea/workflows/test.ymlwith Gitea Actions Demo content and addphp-actions/composer
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: Install composer production dependencies
uses: php-actions/composer@v6
with:
command: install
php_version: "8.3"
args: "--no-dev --ignore-platform-reqs --classmap-authoritative"
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
- push this file to your Gitea repository and in the Actions tab you can follow the generated output
Hi! Try using this action: https://github.com/shivammathur/setup-php, I am currently using it, and it works. +1: These are the runner images I am currently using: https://github.com/catthehacker/docker_images.
Can anyone help me reproduce this issue? I use this action every day in my projects, and have no issues with permissions... but I run it within a normal Github Actions workflow - and I think you're using it elsewhere? Can you help me understand, so I can reproduce it myself?
Gitea provides the ability to run GitHub Actions workflows within Gitea using the nektos/act project. It's possible that the official GitHub runner images include something that prevents this issue, which only occurs with Gitea Runners. By the way, nektos/act also allows running workflows locally (which is actually the project's original purpose). Using it, you could test whether the issue occurs in that environment as well. My guess is that an execution bit might simply be missing somewhere.
I'll test it tomorrow and let you know if I managed to run it successfully.
Hi! Try using this action: https://github.com/shivammathur/setup-php, I am currently using it, and it works. +1: These are the runner images I am currently using: https://github.com/catthehacker/docker_images.
@bencurio that's worked perfectly, thanks!