Download missing packages from repo.magento.com #159
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
| name: Download missing packages from repo.magento.com | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| jobs: | |
| download-packages: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.3' | |
| tools: composer | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| cache: 'npm' | |
| - name: Install Node.js dependencies | |
| run: npm install | |
| - name: Configure Git | |
| run: | | |
| git config user.name "GitHub Actions Bot" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Configure Composer Authentication | |
| run: | | |
| mkdir -p ~/.composer | |
| echo '${{ secrets.COMPOSER_AUTH }}' > ~/.composer/auth.json | |
| - name: Run mirror script | |
| run: node src/make/mirror.js --outputDir=build | |
| - name: Run download script | |
| run: php bin/download-all-missing-packages-from-repo-magento-com.php | |
| - name: Check for changes | |
| id: git-check | |
| run: | | |
| git add resource/additional-packages | |
| if git diff --staged --quiet; then | |
| echo "No changes detected in resource/additional-packages" | |
| echo "changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "Changes detected in resource/additional-packages" | |
| echo "changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create Pull Request | |
| if: steps.git-check.outputs.changes == 'true' | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: Add new packages from repo.magento.com | |
| title: Add new packages from repo.magento.com | |
| body: | | |
| This PR adds new packages downloaded from repo.magento.com by the automated workflow. | |
| Please rebuild the mirror after merging. | |
| Auto-generated by [download-missing-packages workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
| branch: update-packages | |
| delete-branch: true | |
| base: main | |
| add-paths: | | |
| resource/additional-packages/** |