Update PHP Scoper #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update PHP Scoper | |
on: | |
schedule: | |
# Runs at 00:00 UTC every day | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
update-php-scoper: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for all tags and branches | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' # Set the PHP version to your project's requirement | |
- name: Update PHP Scoper | |
id: update | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_ENV: ${{ env.GITHUB_ENV }} | |
run: php .github/scripts/update-php-scoper.php | |
- name: Commit and Push Changes | |
if: env.UPDATED == 'true' | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "Update PHP Scoper to ${{ env.NEW_VERSION }}" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Tag new version | |
if: env.UPDATED == 'true' | |
run: | | |
git tag ${{ env.NEW_VERSION }} | |
git push origin ${{ env.NEW_VERSION }} |