From 2b5cc51b93ea9f9824acadcec88dcf3385fe8aa2 Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Sun, 2 Oct 2022 15:46:49 +0200 Subject: [PATCH] run prettier in github actions + fix github actions username and email --- .github/workflows/lint_and_build.yml | 27 ------------------- .github/workflows/lint_format_and_build.yml | 30 +++++++++++++++++++++ .github/workflows/update_proto.yml | 4 +-- 3 files changed, 32 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/lint_and_build.yml create mode 100644 .github/workflows/lint_format_and_build.yml diff --git a/.github/workflows/lint_and_build.yml b/.github/workflows/lint_and_build.yml deleted file mode 100644 index e1a9ee607..000000000 --- a/.github/workflows/lint_and_build.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Lint and build -on: - push: - branches: - - master - -jobs: - lint: - name: Lint - runs-on: - - ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: install npm dependencies - run: npm i - - name: lint and push automatic fixes - run: | - npm run lint || echo -n - git config user.name 'Github Actions' - git config user.email github-actions@github.com - git add src - git commit -m "Automatic linter fixes" || echo -n - npm run build || echo -n - git add dist - git commit -m "Automatic build" || echo -n - git push diff --git a/.github/workflows/lint_format_and_build.yml b/.github/workflows/lint_format_and_build.yml new file mode 100644 index 000000000..dd8b3fdbd --- /dev/null +++ b/.github/workflows/lint_format_and_build.yml @@ -0,0 +1,30 @@ +name: Lint, format and build +on: + push: + branches: + - master + +jobs: + lint-format-build: + name: Lint, format and build + runs-on: + - ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: install npm dependencies + run: npm i + - name: lint, format, build and push automatic fixes + run: | + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + shopt -s globstar + npm run lint || echo -n + npx prettier --config .prettierrc --ignore-path .prettierignore -w *.ts src/**/*.ts .github/**/*.yml + git add src + git commit -m 'Lint and format code' || echo -n + git push + npm run build + git add dist + git commit -m 'Automatic build' || echo -n + git push diff --git a/.github/workflows/update_proto.yml b/.github/workflows/update_proto.yml index deb1ace57..8c7a5edfe 100644 --- a/.github/workflows/update_proto.yml +++ b/.github/workflows/update_proto.yml @@ -17,10 +17,10 @@ jobs: path: lnd - name: update proto files run: | + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' find lnd/lnrpc -name '*.proto' -exec bash -c 'test -e proto/`basename {}` && cp {} proto' \; sed -i 's/^import.*\//import "/' proto/* - git config user.name 'Github Actions' - git config user.email github-actions@github.com git add proto git commit -m "Update proto files" || echo -n git push