repowarden 4.8.1-next.1 → 4.8.2-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/bots +2 -2
- package/bin/migrer +9 -0
- package/bin/proteger +8 -1
- package/ci/tickets/commun.sh +7 -0
- package/ci/tickets/issue.sh +1 -1
- package/ci/tickets/pr.sh +3 -3
- package/hooks/lib/i18n/en.sh +3 -0
- package/hooks/lib/i18n/fr.sh +3 -0
- package/package.json +1 -1
package/bin/bots
CHANGED
|
@@ -204,7 +204,7 @@ permissions: {}
|
|
|
204
204
|
jobs:
|
|
205
205
|
release:
|
|
206
206
|
uses: simdevWarden/repowarden/.github/workflows/release-auto.yml@v4
|
|
207
|
-
permissions: { contents: write, pull-requests: write, actions: write, checks: read, statuses: write }
|
|
207
|
+
permissions: { contents: write, pull-requests: write, actions: write, checks: read, statuses: write, issues: read }
|
|
208
208
|
with:
|
|
209
209
|
mode: tag
|
|
210
210
|
integration-branch: $INTEGRATION
|
|
@@ -243,7 +243,7 @@ permissions: {}
|
|
|
243
243
|
jobs:
|
|
244
244
|
release:
|
|
245
245
|
uses: simdevWarden/repowarden/.github/workflows/release-auto.yml@v4
|
|
246
|
-
permissions: { contents: write, pull-requests: write, actions: write, checks: read, statuses: write }
|
|
246
|
+
permissions: { contents: write, pull-requests: write, actions: write, checks: read, statuses: write, issues: read }
|
|
247
247
|
YAML
|
|
248
248
|
if [ -n "$AVEC_APP" ]; then
|
|
249
249
|
cat <<'YAML'
|
package/bin/migrer
CHANGED
|
@@ -125,6 +125,15 @@ if [ -f .github/workflows/repogarde.yml ] && [ ! -e .github/workflows/repowarden
|
|
|
125
125
|
fait mig.renamed .github/workflows/repogarde.yml .github/workflows/repowarden.yml
|
|
126
126
|
fi
|
|
127
127
|
|
|
128
|
+
# Releases : notes introduites par les tickets livrés, lisibles sur un dépôt
|
|
129
|
+
# privé seulement avec issues: read (permissions en ligne du job)
|
|
130
|
+
for wf in .github/workflows/*.yml .github/workflows/*.yaml; do
|
|
131
|
+
[ -f "$wf" ] || continue
|
|
132
|
+
grep -q 'repowarden/.github/workflows/release-auto.yml' "$wf" || continue
|
|
133
|
+
reecrire "$wf" -e '/^[[:space:]]*permissions:[[:space:]]*\{[^}]*pull-requests:[^}]*\}/{/issues:/!s/[[:space:]]*\}[[:space:]]*$/, issues: read }/;}' &&
|
|
134
|
+
fait mig.release_issues "$wf"
|
|
135
|
+
done
|
|
136
|
+
|
|
128
137
|
# Suivi des tickets d'une version antérieure : sans l'événement push, le
|
|
129
138
|
# premier push d'une branche de ticket n'ouvre pas la PR brouillon préremplie
|
|
130
139
|
# (ni revue, assignation, fermeture : statuts figés). Section on: remplacée
|
package/bin/proteger
CHANGED
|
@@ -434,7 +434,14 @@ if [ -n "$DRY_RUN" ]; then
|
|
|
434
434
|
exit 0
|
|
435
435
|
fi
|
|
436
436
|
|
|
437
|
-
|
|
437
|
+
# Sans rulesets, le mode de merge ne peut pas être imposé par branche : dans le
|
|
438
|
+
# flux develop, merge commit seul (une livraison squashée casserait l'historique)
|
|
439
|
+
squash=true
|
|
440
|
+
if [ -z "$RULESETS_OK" ] && [ -n "$integration" ]; then
|
|
441
|
+
squash=false
|
|
442
|
+
attention_t ci.proteger.no_squash
|
|
443
|
+
fi
|
|
444
|
+
settings=(-F allow_squash_merge="$squash" -F allow_merge_commit="$merge_commit" -F allow_rebase_merge=false
|
|
438
445
|
-F delete_branch_on_merge="$delete_on_merge" -F allow_auto_merge="$auto_merge"
|
|
439
446
|
-f squash_merge_commit_title=PR_TITLE -f squash_merge_commit_message=PR_BODY)
|
|
440
447
|
[ -z "$integration" ] || settings+=(-f default_branch="$integration")
|
package/ci/tickets/commun.sh
CHANGED
|
@@ -34,6 +34,13 @@ statut() {
|
|
|
34
34
|
gh issue edit "$n" --add-label "$s" ${retirer[@]+"${retirer[@]}"} >/dev/null
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
# Ferme la PR $1 avec le commentaire $2 ; déjà fermée ou mergée entre-temps
|
|
38
|
+
# (merge pendant le run) : rien à faire, pas un échec
|
|
39
|
+
fermer_pr() {
|
|
40
|
+
gh pr close "$1" --comment "$2" >/dev/null 2>&1 && return 0
|
|
41
|
+
[ "$(gh pr view "$1" --json state -q .state 2>/dev/null)" != OPEN ]
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
etiquettes() { gh issue view "$1" --json labels -q '.labels[].name' 2>/dev/null || true; }
|
|
38
45
|
|
|
39
46
|
# REPLY = « <n° de PR> <branche cible> » de la PR dont le merge a fermé le
|
package/ci/tickets/issue.sh
CHANGED
|
@@ -98,7 +98,7 @@ cmd_issue() {
|
|
|
98
98
|
while IFS= read -r pr; do
|
|
99
99
|
[ -n "$pr" ] || continue
|
|
100
100
|
_tr tk.abandoned "$ISSUE"
|
|
101
|
-
|
|
101
|
+
fermer_pr "$pr" "$_T"
|
|
102
102
|
done < <(gh pr list --state open --head "$branche" --json number -q '.[].number')
|
|
103
103
|
gh api -X DELETE "repos/$GH_REPO/git/refs/heads/$branche" >/dev/null
|
|
104
104
|
notice_t tk.branch_deleted "$branche" "$ISSUE"
|
package/ci/tickets/pr.sh
CHANGED
|
@@ -15,19 +15,19 @@ cmd_pr() {
|
|
|
15
15
|
if [[ "$HEAD" == "${INTEGRATION:-develop}" && "${BASE:-}" != "${MAIN:-main}" ]] ||
|
|
16
16
|
[[ "$HEAD" == "${MAIN:-main}" && "${BASE:-}" != "${INTEGRATION:-develop}" ]]; then
|
|
17
17
|
_tr tk.pr_inverted "$HEAD" "${BASE:-}" "${INTEGRATION:-develop}"
|
|
18
|
-
|
|
18
|
+
fermer_pr "$PR" "$_T"
|
|
19
19
|
notice "$_T"
|
|
20
20
|
elif [ "$HEAD" = "${MAIN:-main}" ] &&
|
|
21
21
|
[ "$(gh api "repos/$GH_REPO/compare/$BASE...$HEAD" -q '.files | length')" = 0 ]; then
|
|
22
22
|
_tr tk.pr_backmerge_empty "$HEAD" "$BASE"
|
|
23
|
-
|
|
23
|
+
fermer_pr "$PR" "$_T"
|
|
24
24
|
notice "$_T"
|
|
25
25
|
# Livraison ouverte par le workflow de release : celle d'une personne
|
|
26
26
|
# n'aurait jamais d'approbation de déploiement, elle resterait bloquée
|
|
27
27
|
elif [ "$HEAD" = "${INTEGRATION:-develop}" ] && [ "${DELIVERY_WORKFLOW:-false}" = true ] &&
|
|
28
28
|
[[ "${AUTHOR:-}" != *"[bot]" ]]; then
|
|
29
29
|
_tr tk.pr_delivery_manual "$HEAD" "$BASE" "$HEAD" "$HEAD"
|
|
30
|
-
|
|
30
|
+
fermer_pr "$PR" "$_T"
|
|
31
31
|
notice "$_T"
|
|
32
32
|
return 0
|
|
33
33
|
fi
|
package/hooks/lib/i18n/en.sh
CHANGED
|
@@ -312,6 +312,7 @@ _msg_en() {
|
|
|
312
312
|
mig.dir) _M=".repogarde/ → .repowarden/" ;;
|
|
313
313
|
mig.workflow) _M="%s: uses: to simdevWarden/repowarden, old names replaced" ;;
|
|
314
314
|
mig.renamed) _M="%s → %s" ;;
|
|
315
|
+
mig.release_issues) _M="%s: issues: read added (release notes: delivered tickets readable on a private repository)" ;;
|
|
315
316
|
mig.tickets_events) _M="%s: ticket tracking events completed (push, review, assignment, closing): prefilled draft PR on the first push" ;;
|
|
316
317
|
mig.tickets_labels) _M="Tracking labels (type: feat, statuses…): repowarden tickets init (can be rerun, rewrites no file)" ;;
|
|
317
318
|
mig.hooks_moved) _M="Leftover lefthook hooks (%s) moved to %s" ;;
|
|
@@ -334,6 +335,7 @@ _msg_en() {
|
|
|
334
335
|
ci.proteger.api_error) _M="Ruleset \"%s\" rejected by GitHub: %s" ;;
|
|
335
336
|
ci.proteger.incomplete) _M="Incomplete protection: see the errors above." ;;
|
|
336
337
|
ci.proteger.rulesets_unavailable) _M="Rulesets unavailable for %s: GitHub refuses them on a private repository of a free account. Make the repository public, or move to GitHub Pro / Team; the other settings are applied." ;;
|
|
338
|
+
ci.proteger.no_squash) _M="Without rulesets, the merge method cannot be enforced per branch: squash disabled (merge commit only), otherwise a squashed delivery would break the main branch history." ;;
|
|
337
339
|
ci.proteger.tags_fallback) _M="Tags ruleset: \"GitHub Actions\" bypass refused in this organization; tags protected as on a personal account (not moved or deleted, creation allowed)." ;;
|
|
338
340
|
ci.version.usage) _M="Usage: ci/version.sh next|notes|notes-livraison [ref]" ;;
|
|
339
341
|
ci.version.breaking) _M="Breaking changes" ;;
|
|
@@ -344,6 +346,7 @@ _msg_en() {
|
|
|
344
346
|
ci.version.todo) _M="To do" ;;
|
|
345
347
|
ci.version.update) _M="Update" ;;
|
|
346
348
|
ci.version.tickets) _M="Delivered tickets" ;;
|
|
349
|
+
ci.version.unreadable) _M="Unreadable tickets (%s): add issues: read to the permissions of the release job in release.yml (private repository)." ;;
|
|
347
350
|
ci.livraison.protection) _M="Protection of the %s flow missing (merge commit, no deletion): run repowarden proteger" ;;
|
|
348
351
|
ci.livraison.maintenance) _M="Maintenance only: no version to publish" ;;
|
|
349
352
|
ci.livraison.non_exigee) _M="%s: prerelease not required" ;;
|
package/hooks/lib/i18n/fr.sh
CHANGED
|
@@ -312,6 +312,7 @@ _msg_fr() {
|
|
|
312
312
|
mig.dir) _M=".repogarde/ → .repowarden/" ;;
|
|
313
313
|
mig.workflow) _M="%s : uses: vers simdevWarden/repowarden, anciens noms remplacés" ;;
|
|
314
314
|
mig.renamed) _M="%s → %s" ;;
|
|
315
|
+
mig.release_issues) _M="%s : issues: read ajouté (notes de version : tickets livrés lisibles sur un dépôt privé)" ;;
|
|
315
316
|
mig.tickets_events) _M="%s : événements du suivi des tickets complétés (push, revue, assignation, fermeture) : PR brouillon préremplie au premier push" ;;
|
|
316
317
|
mig.tickets_labels) _M="Étiquettes du suivi (type: feat, statuts…) : repowarden tickets init (relançable, ne réécrit aucun fichier)" ;;
|
|
317
318
|
mig.hooks_moved) _M="Hooks lefthook résiduels (%s) déplacés dans %s" ;;
|
|
@@ -334,6 +335,7 @@ _msg_fr() {
|
|
|
334
335
|
ci.proteger.api_error) _M="Ruleset « %s » refusé par GitHub : %s" ;;
|
|
335
336
|
ci.proteger.incomplete) _M="Protection incomplète : voir les erreurs ci-dessus." ;;
|
|
336
337
|
ci.proteger.rulesets_unavailable) _M="Rulesets indisponibles pour %s : GitHub les refuse sur un dépôt privé d'un compte gratuit. Rendre le dépôt public, ou passer à GitHub Pro / Team ; les autres réglages sont appliqués." ;;
|
|
338
|
+
ci.proteger.no_squash) _M="Sans rulesets, le mode de merge ne peut pas être imposé par branche : squash désactivé (merge commit seul), sinon une livraison squashée casserait l'historique de la branche principale." ;;
|
|
337
339
|
ci.proteger.tags_fallback) _M="Ruleset des tags : exception « GitHub Actions » refusée dans cette organisation ; tags protégés comme sur un compte personnel (ni déplacés ni supprimés, création libre)." ;;
|
|
338
340
|
ci.version.usage) _M="Usage : ci/version.sh next|notes|notes-livraison [ref]" ;;
|
|
339
341
|
ci.version.breaking) _M="Changements incompatibles" ;;
|
|
@@ -344,6 +346,7 @@ _msg_fr() {
|
|
|
344
346
|
ci.version.todo) _M="À faire" ;;
|
|
345
347
|
ci.version.update) _M="Mettre à jour" ;;
|
|
346
348
|
ci.version.tickets) _M="Tickets livrés" ;;
|
|
349
|
+
ci.version.unreadable) _M="Tickets illisibles (%s) : ajouter issues: read aux permissions du job release de release.yml (dépôt privé)." ;;
|
|
347
350
|
ci.livraison.protection) _M="Protection du flux %s absente (merge commit, pas de suppression) : lancer repowarden proteger" ;;
|
|
348
351
|
ci.livraison.maintenance) _M="Maintenance seule : aucune version à publier" ;;
|
|
349
352
|
ci.livraison.non_exigee) _M="%s : préversion non exigée" ;;
|
package/package.json
CHANGED