mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: add autofmt
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
name: Automatically format the code when requested
|
||||
|
||||
on: issue_comment
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
deno: ["v1.x"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git submodule update --init --recursive
|
||||
- uses: denoland/setup-deno@main
|
||||
with:
|
||||
deno-version: ${{ matrix.deno }}
|
||||
- name: Cache dependencies
|
||||
run: deno cache mod.ts
|
||||
- name: Cache Templates
|
||||
run: deno cache template/beginner/mod.ts template/bigbot/src/bot/mod.ts template/bigbot/src/gateway/mod.ts template/bigbot/src/rest/mod.ts template/minimal/mod.ts
|
||||
- name: Format code
|
||||
if: ${{ github.event.issue.pull_request && github.event.comment.body == 'run-fmt' && (github.actor == 'Skillz4Killz' || github.actor == 'itohatweb') }}
|
||||
run: deno fmt
|
||||
- name: Push changes
|
||||
if: ${{ github.event.issue.pull_request && github.event.comment.body == 'run-fmt' && (github.actor == 'Skillz4Killz' || github.actor == 'itohatweb') }}
|
||||
continue-on-error: true # if code is unchanged it will error
|
||||
run: |
|
||||
git config user.name Github Actions
|
||||
git config user.email github-actions@github.com
|
||||
git add .
|
||||
git commit -m "chore: Format code"
|
||||
git push
|
||||
Reference in New Issue
Block a user