Bump actions/upload-artifact from 5 to 6 #79
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: Build dist | |
| on: | |
| pull_request: | |
| types: [ labeled ] | |
| jobs: | |
| build: | |
| if: ${{ github.event.label.name == 'build-dist' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| - name: Setup Node.js 20.x | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 20.x | |
| cache: 'npm' | |
| - run: npm ci --legacy-peer-deps | |
| - run: npm run build | |
| - name: Commit changes if any in dist/ | |
| run: | | |
| if [ -n "$(git status --porcelain dist/)" ]; then | |
| echo "Changes detected in dist/" | |
| git add dist/ | |
| git config --global user.name "github-actions" | |
| git config --global user.email "github-actions@github.com" | |
| git commit -m "Generate dist" | |
| git push origin ${{ github.event.pull_request.head.ref }} | |
| else | |
| echo "No changes" | |
| fi |