Merge pull request #1 from igzard/test/make-limit-test #8
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: 🗃️ Generate indexes | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
run-php-generator: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
tools: composer | |
- name: Install Composer Dependencies | |
run: composer install --no-dev --prefer-dist --no-interaction --optimize-autoloader | |
- name: Run Generator Script | |
run: | | |
chmod +x ./bin/generator | |
./bin/generator | |
- name: Check for Changes | |
id: changes_check | |
run: | | |
if [[ -z $(git status --porcelain) ]]; then | |
echo "No changes detected." | |
echo "changed=false" >> $GITHUB_ENV | |
else | |
echo "Changes detected." | |
echo "changed=true" >> $GITHUB_ENV | |
fi | |
- name: Commit and Push Changes | |
if: env.changed == 'true' | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Update generated files" | |
git push origin master |