THE MEDIA FOR AI THAT ACTUALLY HELPS.French edition · Understand & take action
The interface is in English. Use cases, skills and articles remain in French.
Sentry

Lier un ticket GitHub et Linear à une PR

pr-link-issue

En bref

Ajoute à la description de la PR courante un bloc `#### Issues` au style Sentry, avec le lien de l’issue GitHub et le ticket Linear résolu automatiquement depuis le commentaire de lien Linear de l’issue. On l’utilise pour « lier une issue à la PR » ou lorsqu’une URL d’issue est fournie. On lit d’abord le corps existant : on n’efface rien, on ajoute le bloc, ou l’on remplace la section `#### Issues` déjà présente, sans la dupliquer. Le numéro d’issue suffit si la PR est dans le même dépôt. Ce n’est pas pr-writer, ni iterate-pr.

Ce que ça fait

  • Ajoute ou remplace le bloc `#### Issues` d’une PR, avec l’issue GitHub et le ticket Linear, sans effacer le reste du corps
  • Ne duplique pas une section déjà présente ; la rédaction du titre va à pr-writer, le CI vert à iterate-pr

Pour qui, et un exemple

Les contributeurs Sentry qui doivent rattacher une issue GitHub, et son ticket Linear, à la description d’une PR déjà ouverte.

Exemple de demande : « Ajoute cette issue GitHub et son ticket Linear au bloc Issues de la PR, en remplaçant la section si elle existe déjà, sans toucher au reste. »

Quand il faut lier une issue et un ticket Linear à une PR, et non rédiger le titre, corriger le CI, ou typiser un endpoint. Exemple rédigé par iadujour.fr à partir du SKILL.md, non testé.

Installer

npx skills add getsentry/skills ou, dans Claude Code, claude plugin marketplace add getsentry/skills puis claude plugin install sentry-skills@sentry-skills.

npx skills add getsentry/skills
claude plugin marketplace add getsentry/skills
claude plugin install sentry-skills@sentry-skills

Fonctionne avec

  • Claude Code
  • Cursor
  • Cline
  • GitHub Copilot

Source : README : installation Claude Code, et skills.sh « Works with Claude Code, Cursor, Cline, GitHub Copilot, and other compatible agents ».

Niveau : Intermédiaire

Suppose un projet déjà en place chez l’éditeur et les outils décrits dans le SKILL.md.

À savoir

Dépôt officiel Sentry ; le README précise que ces skills sont destinées aux employés Sentry.

Extrait du SKILL.md

La description d’origine, celle que l’agent lit pour décider de charger la skill (en anglais) :

Append a GitHub issue link and its Linear ticket to the current PR's description. Use when asked to "link issue to pr", "fill in issue and linear in pr", "add issue refs to pr", or when given a GitHub issue URL and asked to attach it to the current PR. Resolves the Linear ticket automatically from the issue's linear-linkback comment.

Citée depuis le SKILL.md au commit ccf58b1 .

Le SKILL.md compte 69 lignes et 3 sections principales :

  • Inputs
  • Steps
  • Notes

Licence : Apache 2.0

Vérifiée le 10 novembre 2026 sur : fichier LICENSE du dépôt .

La licence autorise la reprise : le texte intégral du SKILL.md est reproduit ci-dessous, sans modification, avec sa mention de licence.

Texte intégral du SKILL.md

Reproduit sans modification depuis getsentry/skills (commit ccf58b1) , © Sentry, sous licence Apache 2.0 (fichier de licence d’origine ).

Afficher le SKILL.md original (69 lignes, en anglais)
---
name: pr-link-issue
description: Append a GitHub issue link and its Linear ticket to the current PR's description. Use when asked to "link issue to pr", "fill in issue and linear in pr", "add issue refs to pr", or when given a GitHub issue URL and asked to attach it to the current PR. Resolves the Linear ticket automatically from the issue's linear-linkback comment.
---

# Link a GitHub Issue + Linear Ticket on a PR

Appends a Sentry-style `#### Issues` block to a PR description, referencing both the GitHub issue and the Linear ticket pulled from the issue's `linear-linkback` comment.

## Inputs

- `<issue-url>` — GitHub issue URL like `https://github.com/<owner>/<repo>/issues/<n>`. Issue number alone is fine if the PR is in the same repo.
- (optional) `<pr-number>` — defaults to the open PR for the current branch.

## Steps

1. **Resolve the PR number** — skip if user supplied one:

   ```bash
   gh pr view --json number,body -q '.number'
   ```

   If no PR exists on the branch, stop and tell the user.

2. Extract issue number + repo from the input URL, or accept a bare `#1234` for current repo.

3. Fetch the Linear ticket from the issue's linear-linkback comment:

   ```bash
   gh issue view <n> --repo <owner>/<repo> --json comments \
     -q '.comments[] | select(.author.login=="linear-code") | .body' \
     | grep -Eioe '[a-z]+-[0-9]+' | head -1
   ```

   If no match, fall back to asking the user for the Linear key, or omit it.

4. Read the existing PR body so you can append rather than overwrite:

   ```bash
   gh pr view <pr-number> --json body -q '.body'
   ```

5. Construct the new body. If the body is empty, use just the `#### Issues` block. Otherwise, append it after a blank line. Don't duplicate — if `#### Issues` is already present, replace that section instead of adding a second one.

   Format:

   ```markdown
   #### Issues

   * Resolves: #<n>
   * Resolves: <linear-key>
   ```

6. Update the PR with a heredoc to preserve newlines:

   ```bash
   gh pr edit <pr-number> --body "$(cat <<'EOF'
   <new body>
   EOF
   )"
   ```

7. Confirm by echoing the resulting PR URL:

   ```bash
   gh pr view <pr-number> --json url -q '.url'
   ```

## Notes

- Linear linkback comments are posted by the GitHub user `linear-code`. The body contains a markdown link whose text is the Linear key, e.g. `PY-2357`.
- Project keys vary per repo (`PY-…` for sentry-python, `JS-…` for sentry-javascript, etc.) — the regex `[a-z]+-[0-9]+` covers them.
- Don't strip existing PR content. Always read first, append/replace second.
- If the issue doesn't have a Linear linkback yet (newly filed), proceed with just the GitHub issue reference and tell the user the Linear key is missing.
Source. Fiche rédigée par iadujour.fr à partir de : Frontmatter, sections et corps du SKILL.md, README du dépôt. Consultée le 10 novembre 2026. Dépôt : getsentry/skills .

Dans l’annuaire

Cas d’usage et guides qui partagent un thème, un métier ou un outil avec cette skill.

DANS L’ANNUAIRE

Cas d’usage liés.

Des fiches de l’annuaire qui partagent au moins deux mots-clés précis avec cette skill.

ÉCHANGES

Commentaires.

Un retour d’expérience, une question, une précision sur cette skill ? Les commentaires sont relus avant publication.

Commentaires publiés

Chargement des commentaires…

    Laisser un commentaire

    Charte de modération. Chaque commentaire est relu avant publication. Sont refusés : l’incitation à la haine, les propos injurieux ou discriminatoires, la publicité, le spam et les liens promotionnels, le hors-sujet et les données personnelles d’autrui.