Skip to content

Commit

Permalink
Merge pull request #264 from two-inc/brtkwr/cet-238-bugs-with-billing…
Browse files Browse the repository at this point in the history
…_phone_display-field-in-woocom-integration

CET-238/fix: Sync billing_phone value back to business form
  • Loading branch information
brtkwr authored Apr 23, 2024
2 parents 614a46f + faee3a7 commit a68f3bc
Show file tree
Hide file tree
Showing 8 changed files with 672 additions and 486 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/style.yaml
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 }}
2 changes: 2 additions & 0 deletions .gitignore
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/
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
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
9 changes: 9 additions & 0 deletions .prettierrc
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": []
}
Loading

0 comments on commit a68f3bc

Please sign in to comment.