Skip to content

Commit

Permalink
auto code format on push
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdcvlsc committed Jun 30, 2023
1 parent 342d362 commit 8fce3d1
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: format

on:
push:
branches: [ "master", "main" ]

jobs:
format-code-on-push:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Email
run: git config --local user.email ${{ github.event.pusher.email }}

- name: Configure Name
run: git config --local user.name ${{ github.event.pusher.name }}

- name: Git Status
run: git status

- name: Format Code Style
run: npm run format

- name: Stage Changes
run: git add .

- name: Save Changes
run: git commit -m ${{ github.event.head_commit.message }}:format

- name: Push Changes
run: git push --force
24 changes: 20 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
import path from 'path';
import { fileURLToPath } from 'url';
import {





fileURLToPath } from 'url';
import { showLocalNetworkIP } from './shownet.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const __filename =
fileURLToPath(
import.meta.url



);


const __dirname = path.
dirname(__filename);

const PORT = process.env.PORT || 8080;
showLocalNetworkIP(PORT);
showLocalNetworkIP(
PORT);

import fastify from 'fastify';

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml → linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:

# VALIDATE_PYTHON_BLACK: true
VALIDATE_JAVASCRIPT_ES: true
VALIDATE_HTML: true
VALIDATE_CSS: true
# VALIDATE_HTML: true
# VALIDATE_CSS: true

# where your linter config files should go like;
# .prettierrc.json, .clang-fromat, .eslintrc.yml, .htmlhintrc, etc.
Expand Down
File renamed without changes.

0 comments on commit 8fce3d1

Please sign in to comment.