Skip to content

Commit 6265937

Browse files
roboadhocvib-adhoc
andauthored
[IMP] Update repository from template (#469)
Co-authored-by: Virginia <vib@adhoc.inc>
1 parent 250b598 commit 6265937

3 files changed

Lines changed: 24 additions & 6 deletions

File tree

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
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: 95203e6
2+
_commit: 8677dea
33
_src_path: https://github.com/ingadhoc/addons-repo-template.git
44
description: 'ADHOC Odoo website Modules
55

.github/instructions/models.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ applyTo:
5050

5151
## Nombres y estilo
5252

53-
- Métodos privados prefijo `_`; en Odoo 19, preferir `@api.private` donde aplica.
53+
- Métodos privados prefijo `_` (sigue siendo la convención estándar; ya bloquea RPC por sí solo). `@api.private` **no** es un reemplazo del prefijo: es para el caso de excepción de un método sin `_` (API pública existente, o método interno del ORM) que necesita bloquearse de RPC sin renombrarlo. Ver docstring de `private` en `odoo/orm/decorators.py`.
5454
- Métodos muy largos (>50 líneas) → sugerir split.
5555
- Comparaciones booleanas: `if x:` / `if not x:` (no `== True` / `== False`).
5656
- `else` después de `return` innecesario.

.github/workflows/pre-commit.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,46 @@ jobs:
1818
pre-commit:
1919
runs-on: ubuntu-latest
2020
steps:
21+
-
22+
name: Block sensitive file changes from fork PRs
23+
if: >-
24+
github.event_name == 'pull_request_target' &&
25+
github.event.pull_request.head.repo.full_name != github.repository
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
changed=$(gh api --paginate \
30+
"repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" \
31+
--jq '.[].filename')
32+
if echo "$changed" | grep -qE '^(\.github/workflows/|\.pre-commit-config\.yaml$)'; then
33+
echo "::error::Fork PRs may not modify workflows or the pre-commit config. Blocked for security."
34+
exit 1
35+
fi
2136
-
2237
name: Checkout
23-
uses: actions/checkout@v4
38+
uses: actions/checkout@v7
2439
with:
2540
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
41+
allow-unsafe-pr-checkout: true
2642
-
2743
id: setup-python
2844
name: Setup Python
29-
uses: actions/setup-python@v5
45+
uses: actions/setup-python@v7
3046
with:
3147
python-version: "3.10"
3248
cache: "pip"
3349
-
3450
name: Pre-commit cache
35-
uses: actions/cache@v4
51+
uses: actions/cache@v6
3652
with:
3753
path: ~/.cache/pre-commit
3854
key: pre-commit|${{ steps.setup-python.outputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
3955
-
4056
id: precommit
4157
name: Pre-commit
42-
uses: pre-commit/action@v3.0.1
58+
run: |
59+
pip install pre-commit
60+
pre-commit run --all-files --show-diff-on-failure --color=always
4361
-
4462
name: Create commit status
4563
if: github.event_name == 'pull_request_target'

0 commit comments

Comments
 (0)