@@ -96,18 +96,34 @@ jobs:
9696 git push origin --delete "$BRANCH"
9797 fi
9898
99- # A release that ships canister changes without touching docs/ leaves
100- # the synced pages byte-identical, so there is no content to review.
101- # The pin still has to move: it is allowed to sit on a commit only
102- # while no release carries the pages, and skipping here would strand
103- # it on that commit for good. So the PR is opened either way, and the
104- # body says which of the two it is.
10599 CHANGED=$(git -C /tmp/certified-assets diff --name-only "${PIN}..${TAG}" -- docs/)
106- echo "needed=true" >> $GITHUB_OUTPUT
107100 if [ -z "$CHANGED" ]; then
108- echo "No docs/ changes between $PIN and $TAG: advancing the pin only."
109- echo "pin_only=true" >> $GITHUB_OUTPUT
101+ # A release that ships canister changes without touching docs/ leaves
102+ # the synced pages byte-identical, so there is nothing to review. Two
103+ # cases, and only one of them is worth a pull request.
104+ if [ -n "$INPUT_REF" ] || ! git -C /tmp/certified-assets show-ref \
105+ --verify --quiet "refs/tags/${PIN}"; then
106+ # The pin is a commit (or a ref was dispatched by hand). Moving it
107+ # onto the tag is the point: a commit pin is allowed only while no
108+ # release carries the pages, and skipping here would strand it
109+ # there for good.
110+ echo "No docs/ changes between $PIN and $TAG: advancing the pin only."
111+ echo "needed=true" >> $GITHUB_OUTPUT
112+ echo "pin_only=true" >> $GITHUB_OUTPUT
113+ else
114+ # The pin is already a tag, so a pull request would carry an empty
115+ # page diff and a bumped ref, for a reader to review and merge with
116+ # nothing in it. The pin lags the release and stays accurate: it
117+ # says which ref this copy came from, and the copy still matches it.
118+ # The release itself is not lost, since the recipe that deploys this
119+ # canister releases in lockstep and is tracked under `watched`.
120+ echo "No docs/ changes between $PIN and $TAG, and the pin is a tag."
121+ echo "Nothing to sync."
122+ echo "needed=false" >> $GITHUB_OUTPUT
123+ exit 0
124+ fi
110125 else
126+ echo "needed=true" >> $GITHUB_OUTPUT
111127 echo "Changed upstream pages:"
112128 echo "$CHANGED"
113129 echo "pin_only=false" >> $GITHUB_OUTPUT
0 commit comments