diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000000..ad22ef2d97 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,18 @@ +#copied from https://github.com/pre-commit/action +name: pre-commit + +on: + pull_request: +# push: +# branches: [master] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.3 + # this will push back fixes to the pull request branch. + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.secrets.baseline b/.secrets.baseline index ed05db4af5..7c5f46bb02 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -194,7 +194,7 @@ "filename": "packages/botonic-core/src/hubtype-service.ts", "hashed_secret": "c2eb2eb7f85ce9e0e986e19415b6e106b0d7d8d6", "is_verified": false, - "line_number": 11 + "line_number": 36 } ], "packages/botonic-plugin-contentful/tests/contentful/contents/button.test.ts": [ @@ -266,5 +266,5 @@ } ] }, - "generated_at": "2021-08-31T11:10:00Z" + "generated_at": "2021-09-20T13:18:28Z" } diff --git a/packages/botonic-plugin-contentful/src/util/backoff.ts b/packages/botonic-plugin-contentful/src/util/backoff.ts index ed4780b264..4505378ab6 100644 --- a/packages/botonic-plugin-contentful/src/util/backoff.ts +++ b/packages/botonic-plugin-contentful/src/util/backoff.ts @@ -26,7 +26,7 @@ export async function repeatWithBackoff( for (;;) { try { return await func() - } catch (e) { + } catch (e: any) { const stack = e.stack ? `\nat:\n${String(e.stack)}` : ' (no stack available)' diff --git a/scripts/qa/lint-d-ts.sh b/scripts/qa/lint-d-ts.sh index b23908bb9b..c0862cef0b 100755 --- a/scripts/qa/lint-d-ts.sh +++ b/scripts/qa/lint-d-ts.sh @@ -1,4 +1,11 @@ #!/bin/bash +if [ "$GITHUB_ACTIONS" == "true" ]; then + echo 'Will skip tsc as it will run in separate workflow' + exit +else + echo "Will run tsc for package $1" +fi + BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/scripts/qa/lint-package.sh b/scripts/qa/lint-package.sh index be226656a6..ae972cca2b 100755 --- a/scripts/qa/lint-package.sh +++ b/scripts/qa/lint-package.sh @@ -1,4 +1,12 @@ #!/bin/bash + +if [ "$GITHUB_ACTIONS" == "true" ]; then + echo 'Will skip lint as it will run in separate workflow' + exit +else + echo "Will run linters for package $1" +fi + cd "$1" || exit # quick lint. Not running slow lint to avoid penalizing pre-commit