Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: configure pre-commit workflow #PLA-695 #1888

Merged
merged 4 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -266,5 +266,5 @@
}
]
},
"generated_at": "2021-08-31T11:10:00Z"
"generated_at": "2021-09-20T13:18:28Z"
}
2 changes: 1 addition & 1 deletion packages/botonic-plugin-contentful/src/util/backoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function repeatWithBackoff<T>(
for (;;) {
try {
return await func()
} catch (e) {
} catch (e: any) {
const stack = e.stack
? `\nat:\n${String(e.stack)}`
: ' (no stack available)'
Expand Down
7 changes: 7 additions & 0 deletions scripts/qa/lint-d-ts.sh
Original file line number Diff line number Diff line change
@@ -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 )"


Expand Down
8 changes: 8 additions & 0 deletions scripts/qa/lint-package.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down