Link to source on Title and Chapters in the Manga Details modal #222
Workflow file for this run
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: Format Commits | |
# This action works with pushes | |
on: | |
workflow_dispatch: {} # Manuall trigger | |
pull_request: | |
branches: [main] | |
paths: | |
- '**.js' | |
- '**.html' | |
- '**.css' | |
- '**.md' | |
push: | |
branches: [main] | |
paths: | |
- '**.js' | |
- '**.html' | |
- '**.css' | |
- '**.md' | |
jobs: | |
prettier: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: npm | |
- name: Prettify code format | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npm ci --silent --omit optional | |
npx prettier --write "**/*.{js,md,html,css}" | |
if ! $(git diff --quiet); then | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -am 'Reformatted file' | |
git push | |
if [ ${{ github.event_name }} == 'pull_request' ]; then | |
gh pr comment ${{ github.event.number }} --body 'Reformatted your code following [our guidelines](https://github.com/Animeboynz/Mihon-Backup-Viewer/blob/main/CONTRIBUTING.md#formatting-your-code). | |
Remember to `git pull` if you plan to continue working on this PR' | |
fi | |
fi |