-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #264 from two-inc/brtkwr/cet-238-bugs-with-billing…
…_phone_display-field-in-woocom-integration CET-238/fix: Sync billing_phone value back to business form
- Loading branch information
Showing
8 changed files
with
672 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Style | ||
|
||
permissions: write-all | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: self-hosted | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} | ||
- name: Setup dependencies | ||
run: | | ||
pip install pre-commit | ||
pre-commit install | ||
- name: Run pre-commit hook | ||
run: | | ||
set +e -o pipefail | ||
pre-commit run --from-ref origin/${{ github.base_ref }} --to-ref HEAD --show-diff-on-failure | tee pre-commit-output | ||
exit_code=$? | ||
set -e +o pipefail | ||
cat << EOT >> $GITHUB_OUTPUT | ||
EXIT_CODE=$exit_code | ||
OUTPUT<<EOL | ||
$(cat pre-commit-output | sed 's/`/\\`/g') | ||
EOL | ||
EOT | ||
exit $exit_code | ||
id: pre-commit | ||
continue-on-error: true | ||
|
||
- name: Delete Previous Comment | ||
uses: brtknr/delete-comment@v1 | ||
with: | ||
github_token: '${{ secrets.GITHUB_TOKEN }}' | ||
delete_user_name: 'github-actions[bot]' | ||
body_regex: 'Pre-commit' | ||
issue_number: '${{ github.event.number }}' | ||
|
||
- name: Notify Pull Request | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const hint = ${{ steps.pre-commit.outcome == 'success' }} ? '' : ` | ||
Looks like the PR is missing pre-commit changes. Please run the following locally and commit changes to fix this issue: | ||
\`\`\` | ||
pre-commit install # only if you do not have it installed already | ||
git fetch origin | ||
pre-commit run --from-ref origin/${{ github.base_ref }} --to-ref HEAD | ||
git commit -a | ||
git push | ||
\`\`\` | ||
`; | ||
const output = ` | ||
# 🖌 Pre-commit ${{ steps.pre-commit.outcome }} ${{ steps.pre-commit.outcome == 'success' && '🏆' || '🚫' }} | ||
${hint} | ||
<details><summary>Details</summary> | ||
\`\`\` | ||
${{ steps.pre-commit.outputs.OUTPUT }} | ||
\`\`\` | ||
Exit code: ${{ steps.pre-commit.outputs.EXIT_CODE }} | ||
</details> | ||
Author ✍️@${{ github.actor }}`; | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: output | ||
}) | ||
- name: Pre-commit status | ||
run: | | ||
cat << EOF | ||
${{ steps.pre-commit.outputs.OUTPUT }} | ||
EOF | ||
exit ${{ steps.pre-commit.outputs.EXIT_CODE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.idea | ||
.env | ||
*.env.json | ||
.DS_Store | ||
package-lock.json | ||
screenshots/ | ||
videos/ | ||
node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.1.0 | ||
hooks: | ||
- id: prettier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"useTabs": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"printWidth": 100, | ||
"plugins": [] | ||
} |
Oops, something went wrong.