Skip to content

Commit

Permalink
Add GitHub action to allow formatting website code with workflow disp…
Browse files Browse the repository at this point in the history
…atch (#825)

* Create format-website-on-dispatch.yml

* Update format-website-on-dispatch.yml
  • Loading branch information
theosanderson authored Jan 23, 2024
1 parent c904db1 commit 3773d3d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/format-website-on-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Format and Commit Code

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # You can change this to your required Node.js version

- name: Change Directory and Run NPM Install
working-directory: website
run: |
npm install
npm run format
- name: Commit and Push Changes
run: |
git config --global user.name 'Loculus bot'
git config --global user.email 'bot@loculus.org'
git add -A
git commit -m "Automated code formatting" || echo "No changes to commit"
git push

0 comments on commit 3773d3d

Please sign in to comment.