From ee89641610d235bc5c07084c9c7a9178bc405c41 Mon Sep 17 00:00:00 2001 From: "sourcegraph-commit-signing-s2[bot]" <292215795+sourcegraph-commit-signing-s2[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 00:06:58 +0000 Subject: [PATCH] chore/ci: Update the DiffTour workflow to match the shared action README Adding the shared sourcegraph/actions/diff-tour action to comment on PRs with the Diff Tour link. Please make any needed improvements to the shared action, so all of our repos using it benefit. Co-authored-by: marcleblanc2 --- .github/workflows/diff-tour.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/diff-tour.yml b/.github/workflows/diff-tour.yml index 25a20de07..78abbc7c5 100644 --- a/.github/workflows/diff-tour.yml +++ b/.github/workflows/diff-tour.yml @@ -1,26 +1,27 @@ -name: Diff Tour link +# This GitHub Action imported from the shared action +# https://github.com/sourcegraph/actions/blob/main/diff-tour/ +# Please make fixes / enhancements in the shared action, +# so all of our repos get the benefits -# Posts a comment on each pull request linking to the Sourcegraph Diff Tour -# for the changes in that PR, and keeps the comment up to date as the PR -# changes. Once the PR is merged, the link points at the merge commit. -# -# Pull requests from forks are skipped: their GITHUB_TOKEN is read-only, so -# the comment cannot be posted. +name: Diff Tour link on: pull_request: - types: [opened, synchronize, reopened, closed] + # `edited` fires when the base branch changes; `synchronize` does not + # `closed` fires on merge and on plain close; either way the comment is + # updated to a link that survives deleting the head branch + types: [closed, edited, opened, reopened, synchronize] +# The only permission needed. The action does not check out your repo, so +# `contents: read` is not required, even for private repos permissions: - contents: read pull-requests: write jobs: - diff-tour-link: - name: Comment the Diff Tour link on the pull request + diff-tour: + name: Comment runs-on: ubuntu-latest - if: > - github.event.pull_request.head.repo.full_name == github.repository - && (github.event.action != 'closed' || github.event.pull_request.merged) + # Diff Tour resolves branch names against the base repo, so skip fork PRs + if: github.event.pull_request.head.repo.full_name == github.repository steps: - uses: sourcegraph/actions/diff-tour@main