Skip to content

Echo/print from php are not showed #36044

@Elikill58

Description

@Elikill58

Description

I'm trying to setup workflow. I tried lot of things. On github, this is working fine:

name: Github Actions
on: [push]

jobs:
  run-php:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.2'   # adapte si besoin (7.4, 8.0, etc.)
      - name: Run run.php
        run: php -d display_errors=1 -f run.php
      - run: php -r "echo 'Hello, world.';"
      - run: php -r "phpinfo();"
      - run: php -r "print('Hello, world.');"
      - name: List files in the repository
        run: |
          ls ${{ github.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."

As showed here.

On gitea, the same script (with adapted variable) like this:

name: Gitea Actions
on: [push]

jobs:
  run-php:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.2'   # adapte si besoin (7.4, 8.0, etc.)
      - name: Run run.php
        run: php -d display_errors=1 -f run.php
      - run: php -r "echo 'Hello, world.';"
      - run: php -r "phpinfo();"
      - run: php -r "print('Hello, world.');"
      - name: List files in the repository
        run: |
          ls ${{ gitea.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."

Doesn't provide any output for echo/print. Only the phpinfo() seems to send data. The php is well runned (in both case, the run.php file is <?php echo("test"); file_put_contents("some-file.txt", "my-content"); as used on github example.

I tried installing php by myself with apt install command instead of using shivammathur/setup-php, but I got the same result.

My runner is launch with docker run -d -e GITEA_INSTANCE_URL=http://my-url -e GITEA_RUNNER_REGISTRATION_TOKEN=myToken -v /var/run/docker.sock:/var/run/docker.sock --name gitea_runner gitea/act_runner:nightly

Gitea Version

1.25.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Linux/Ubuntu

How are you running Gitea?

self hosted, running on docker

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions