Skip to content

Add files via upload #46

Add files via upload

Add files via upload #46

Workflow file for this run

name: Auto-format JavaScript
on:
push:
branches: [ "master", "code-formatting" ]
paths:
- mods/*.js
- generate.js
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v6
- name: Format JavaScript code
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm -g install js-beautify && js-beautify -r mods/*.js generate.js --config .formatting.json && git pull
- name: Commit changes
uses: EndBug/add-and-commit@v10 # You can change this to use a specific version.
with:
# The arguments for the `git add` command (see the paragraph below for more info)
# Default: '.'
add: 'mods/*.js generate.js'
# The name of the user that will be displayed as the author of the commit.
# Default: depends on the default_author input
author_name: SparkleBot
# The email of the user that will be displayed as the author of the commit.
# Default: depends on the default_author input
author_email: mail@example.com
# Determines the way the action fills missing author name and email. Three options are available:
# - github_actor -> UserName <UserName@users.noreply.github.com>
# - user_info -> Your Display Name <your-actual@email.com>
# - github_actions -> github-actions <email associated with the github logo>
# Default: github_actor
default_author: github_actor
# Arguments for the git fetch command. If set to false, the action won't fetch the repo.
# For more info as to why fetching is usually recommended, please see the "Performance on large repos" FAQ.
# Default: --tags --force
fetch: false
# The message for the commit.
# Default: 'Commit from GitHub Actions (name of the workflow)'
message: 'Format JavaScript code'
# The way the action should handle pathspec errors from the add and remove commands. Three options are available:
# - ignore -> errors will be logged but the step won't fail
# - exitImmediately -> the action will stop right away, and the step will fail
# - exitAtEnd -> the action will go on, every pathspec error will be logged at the end, the step will fail.
# Default: ignore
pathspec_error_handling: ignore
push: true