fix: allow write permission for this job dependency_updater.yml #3
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: Composer Update | |
on: | |
schedule: | |
- cron: '0 0 * * 0' # This will run every Sunday at midnight | |
push: | |
branches: | |
- main | |
jobs: | |
update: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' # Specify your PHP version | |
tools: composer | |
- name: Update Composer dependencies | |
run: composer update | |
- name: Commit changes | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add composer.json composer.lock | |
git commit -m "Automated Composer update" || echo "No changes to commit" | |
git push |