Skip to content

Commit 7b000bf

Browse files
authored
Merge pull request #1147 from dnum-mi/tech/allow-merge-into-main-only-from-develop
ci: 🔒 ajoute workflow pour restreindre les merge vers main
2 parents 0d5e0ff + 77e769d commit 7b000bf

File tree

7 files changed

+59
-22
lines changed

7 files changed

+59
-22
lines changed

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## 🚨 Rappel
2+
3+
> ⚠️ Toutes les PR doivent être ouvertes **vers `develop`** (jamais directement vers `main`).
4+
>
5+
> Si vous voyez `main` comme branche de destination, changez-la avant de soumettre la PR.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Enforce merge policy to main
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, reopened, synchronize, ready_for_review]
7+
8+
jobs:
9+
check-merge-source:
10+
name: Verify source branch
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Ensure PR comes only from develop
14+
if: github.head_ref != 'develop'
15+
run: |
16+
echo "❌ Cette PR ne peut pas être fusionnée directement dans main."
17+
echo "➡️ Seule la branche 'develop' est autorisée à merger vers 'main'."
18+
echo "Branche actuelle : '${{ github.head_ref }}'"
19+
exit 1

.github/workflows/publish-release-beta.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,22 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
1416
- name: Setup Node.js
15-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v4
1618
with:
17-
always-auth: true
18-
node-version: 18
19+
node-version: 24
20+
registry-url: 'https://registry.npmjs.org'
1921
- name: Install pnpm
20-
run: npm i -g pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: latest
2125
- name: Install dependencies
2226
run: pnpm install --frozen-lockfile
2327
- name: Release
2428
env:
2529
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_MININT_TOKEN }}
2731
run: pnpm run semantic-release

.github/workflows/publish-release-next.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,22 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
1416
- name: Setup Node.js
15-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v4
1618
with:
17-
always-auth: true
18-
node-version: 18
19+
node-version: 24
20+
registry-url: 'https://registry.npmjs.org'
1921
- name: Install pnpm
20-
run: npm i -g pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: latest
2125
- name: Install dependencies
2226
run: pnpm install --frozen-lockfile
2327
- name: Release
2428
env:
2529
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_MININT_TOKEN }}
2731
run: pnpm run semantic-release

.github/workflows/publish-release.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Release
22
on:
33
push:
44
branches:
5-
- beta
65
- main
76

87
jobs:
@@ -11,18 +10,22 @@ jobs:
1110
runs-on: ubuntu-22.04
1211
steps:
1312
- name: Checkout
14-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
1516
- name: Setup Node.js
16-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v4
1718
with:
18-
always-auth: true
19-
node-version: 20.11
19+
node-version: 24
20+
registry-url: 'https://registry.npmjs.org'
2021
- name: Install pnpm
21-
run: npm i -g pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: latest
2225
- name: Install dependencies
2326
run: pnpm install --frozen-lockfile
2427
- name: Release
2528
env:
2629
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
NPM_TOKEN: ${{ secrets.NPM_MININT_TOKEN }}
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_MININT_TOKEN }}
2831
run: pnpm run semantic-release

.github/workflows/run-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ jobs:
2323
- name: Setup Node.js
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 22
26+
node-version: 24
2727
- name: Install pnpm
28-
run: npm i -g pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
version: latest
2931
- name: Install dependencies
3032
run: pnpm install --frozen-lockfile
3133
- name: Lint (show only errors)

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@gouvminint:registry=https://registry.npmjs.com
2-
//registry.npmjs.com/:_authToken=${NPM_TOKEN}
2+
//registry.npmjs.com/:_authToken=${NODE_AUTH_TOKEN}
33
always-auth=true
44
legacy-peer-deps=true
55
access=public

0 commit comments

Comments
 (0)