shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.85k stars 334 forks source link

Add support for GitHub tokens #815

Closed skyzyx closed 5 months ago

skyzyx commented 5 months ago

Describe the feature Add support for:

with:
  token: ${{ secrets.GITHUB_TOKEN }}

Version

Underlying issue The action does not support passing a valid GitHub token into the action.

Describe alternatives None. It would require using a different action, or writing one from scratch.

Additional context We have GitHub Enterprise Server, and use self-hosted GitHub Actions runners. We regularly hit the GitHub API rate limits when using this action.

Are you willing to submit a PR? I don't know JavaScript, so I cannot.

shivammathur commented 5 months ago

@skyzyx

Try setting the GITHUB_TOKEN env in the setup-php step.

- name: Setup PHP
  uses: shivammathur/setup-php@v2
  with:
    php-version: '8.3'
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
skyzyx commented 5 months ago

Oh, that seems to work.

Any chance that information can be added to the read me?

Thanks!

shivammathur commented 5 months ago

It is documented here https://github.com/shivammathur/setup-php?tab=readme-ov-file#wrench-tools-support https://github.com/shivammathur/setup-php?tab=readme-ov-file#github-composer-authentication