Skip to content

Commit 3bf1f5c

Browse files
committed
[IMP] account-invoicing: pre-commit improvements
1 parent e38af5d commit 3bf1f5c

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.copier-answers.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: 719579f
2+
_commit: 00cee12
33
_src_path: https://github.com/ingadhoc/addons-repo-template.git
44
description: Odoo Invoicing Extension Addons
55
is_private: false

.github/workflows/pre-commit.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ name: pre-commit
66

77
on:
88
push:
9-
branches: "*.0"
10-
pull_request:
9+
branches: "[0-9][0-9].0"
10+
pull_request_target:
1111

1212
jobs:
1313
pre-commit:
@@ -16,6 +16,8 @@ jobs:
1616
-
1717
name: Checkout
1818
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
1921
-
2022
id: setup-python
2123
name: Setup Python
@@ -30,5 +32,18 @@ jobs:
3032
path: ~/.cache/pre-commit
3133
key: pre-commit|${{ steps.setup-python.outputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
3234
-
35+
id: precommit
3336
name: Pre-commit
3437
uses: pre-commit/action@v3.0.1
38+
-
39+
name: Create commit status
40+
if: github.event_name == 'pull_request_target'
41+
run: |
42+
curl -L \
43+
-X POST \
44+
-H "Accept: application/vnd.github+json" \
45+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
46+
-H "X-GitHub-Api-Version: 2022-11-28" \
47+
https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
48+
-d '{"state":"${{ steps.precommit.outcome }}","context":"mergebot/pre-commit"}' \
49+
--fail

0 commit comments

Comments
 (0)