Merge pull request #130 from MekDrop/ci/autobuild-6 #8
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: Update dist folder | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: 'autobuild' | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-dist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run format | |
| run: npm run format | |
| - name: Run pack | |
| run: npm run pack | |
| - name: Set current date as integer | |
| id: date | |
| run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
| - name: Set Branch Name | |
| id: set-branch | |
| run: echo "branch_name=autobuild-${{ steps.date.outputs.date }}" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| id: create_pr | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ steps.set-branch.outputs.branch_name }} | |
| title: "[AUTOBUILD] ${{ steps.date.outputs.date }}" | |
| body: "Auto-generated update to dist/ from latest main push" | |
| base: main | |
| labels: | | |
| autobuild | |
| commit-message: "autobuild" | |
| author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | |
| delete-branch: true | |
| signoff: false | |
| maintainer-can-modify: false | |
| - name: Sleep for 30 seconds | |
| if: ${{ steps.create_pr.outputs.pull-request-number }} | |
| uses: juliangruber/sleep-action@v2.0.0 | |
| with: | |
| time: 30s | |
| - name: Auto-merge PR | |
| if: ${{ steps.create_pr.outputs.pull-request-number }} | |
| uses: pascalgn/automerge-action@v0.15.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| MERGE_LABELS: autobuild | |
| MERGE_METHOD: squash | |
| MERGE_DELETE_BRANCH: "true" | |
| MERGE_COMMIT_MESSAGE: pull-request-title |