NWJS upgrade 0.95.0 #12
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: Prettier hook for PRs | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: [develop, master] | |
push: | |
branches: [develop, master] | |
jobs: | |
ci-pr: | |
# Run on any change from PR or direct push, but don't run on a cancel PR | |
if: github.event_name != 'pull_request' || ( | |
github.event.action == 'opened' || | |
github.event.action == 'synchronize' || | |
github.event.action == 'reopened' && github.event.before != github.event.after || | |
github.event.action == 'closed' && github.event.pull_request.merged == true | |
) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '23.3.0' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --legacy-peer-deps | |
- name: Confirm code format | |
run: npm prettier | |
- name: Commit changes | |
run: | | |
git config --global user.name "maria[bot]" | |
git config --global user.email "maria[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Auto-format code with prettier" || echo "No changes to commit" | |
git push | |
ci-close-pr: | |
# Run on a cancel PR | |
if: github.event_name == 'pull_request' && github.event.pull_request.merged == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Just report closed, nothing to do | |
run: | | |
echo PR #${{ github.event.number }} has been closed, not merged |