Run Ide-helper automatically #5
This file contains hidden or 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
on: [ pull_request ] | |
name: CI | |
jobs: | |
refresh-ide-helper: | |
runs-on: ubuntu-latest | |
container: | |
image: kirschbaumdevelopment/laravel-test-runner:8.2 | |
services: | |
mysql: | |
image: mysql:8.3 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: test | |
ports: | |
- 33306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install composer dependencies | |
run: | | |
composer install --no-scripts | |
- name: Set up database | |
run: | | |
php artisan migrate:fresh | |
- name: Generate ide-helper comments | |
run: php artisan ide-helper:refresh | |
- name: Configure Git | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email '[email protected]' | |
git config --global --add safe.directory /__w/mars # Add the original repo name as safe | |
- name: Commit changes | |
run: | | |
git add . | |
git commit -m "Refresh ide-helper automatically" || echo "No changes to commit" | |
- name: Push changes | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
git push https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git HEAD:main | |