[FEATURE] Ajouter une action pour fermer les anciennes pull requests#81
Open
theotime2005 wants to merge 2 commits into
Open
[FEATURE] Ajouter une action pour fermer les anciennes pull requests#81theotime2005 wants to merge 2 commits into
theotime2005 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Cette PR ajoute une action composite centralisée pour fermer automatiquement les pull requests inactives, avec une documentation d’utilisation dans le README.
Changes:
- Ajout d’une nouvelle action
close-old-pull-requests. - Ajout d’un exemple de workflow pour l’utiliser.
- Ajout d’un
.gitignore.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
README.md |
Documente l’utilisation de la nouvelle action. |
close-old-pull-requests/action.yml |
Définit l’action composite de fermeture des PR inactives. |
.gitignore |
Ignore les fichiers macOS et JetBrains. |
Comments suppressed due to low confidence (3)
close-old-pull-requests/action.yml:20
- This composite action run step is missing an explicit
shell. Composite actions requireshellon steps that userun, so this action metadata will fail validation before the script can execute.
run: |
close-old-pull-requests/action.yml:23
- Only the first 100 open pull requests are fetched. Repositories with more than 100 open PRs can leave older inactive PRs unprocessed, which undermines the scheduled cleanup; paginate or raise the limit enough to cover all open PRs.
OPENED_PRS=$(gh pr list --json number,updatedAt --limit 100)
close-old-pull-requests/action.yml:34
- The close message tells users they can put the PR in draft to avoid future closure, but the action does not query or skip draft PRs, so draft PRs older than 30 days will still be closed.
gh pr close "$PR_NUMBER" --comment "Cette pull request a été fermée car elle est inactive depuis un mois. Vous pouvez la réouvrir ou la mettre en draft pour éviter qu'elle ne soit refermée." --delete-branch
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| check-inactive-prs: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: pix-actions/close-old-pull-requests@main |
| ``` | ||
|
|
||
| ## close-old-pull-requests | ||
| Une actions qui permet de fermer les pull requests qui n'ont pas été mises à jour depuis un certain temps. Utile pour éviter d'avoir des PRs qui traînent sans être traitées. |
Comment on lines
+2
to
+3
| description: >- | ||
| Close inactive pull requests that have not been updated for a specified number of days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💥 Problème
L'action de fermeture des vieilles pull requests est maintenant en place depuis environ 1 an sur le monorepo voir 1024pix/pix#12215.
👩🚀 Proposition
Centraliser cette action dans pix-action pour pouvoir l'appeler depuis les autres repos.
👁️ Remarques
On pourrait variabiliser davantage, mais je ne l'ai pas fait par souci de simplicité.
♻️ Pour tester