File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,16 @@ case "$ecosystem" in
3030 ;;
3131esac
3232
33+ for path in state base.sha; do
34+ if [[ ! -f " $bundle_dir /$path " ]]; then
35+ echo " missing artifact file: $path " >&2
36+ exit 1
37+ fi
38+ done
39+
40+ expected_base=$( tr -d ' [:space:]' < " $bundle_dir /base.sha" )
41+ .github/scripts/verify-dependency-base " $expected_base " > /dev/null
42+
3343state=$( tr -d ' [:space:]' < " $bundle_dir /state" )
3444case " $state " in
3545 noop)
@@ -43,16 +53,13 @@ case "$state" in
4353 ;;
4454esac
4555
46- for path in base.sha deterministic.patch final.patch title.txt body.md; do
56+ for path in deterministic.patch final.patch title.txt body.md; do
4757 if [[ ! -f " $bundle_dir /$path " ]]; then
4858 echo " missing artifact file: $path " >&2
4959 exit 1
5060 fi
5161done
5262
53- expected_base=$( tr -d ' [:space:]' < " $bundle_dir /base.sha" )
54- .github/scripts/verify-dependency-base " $expected_base " > /dev/null
55-
5663tree_from_patch () {
5764 local patch=$1
5865 local index
Original file line number Diff line number Diff line change @@ -69,6 +69,22 @@ if (cd "$git_fixture/work" && "$verify_base" "${main_oid}0") >/dev/null 2>&1; th
6969 exit 1
7070fi
7171
72+ stale_noop=$test_root /stale-noop
73+ mkdir -p " $stale_noop " " $git_fixture /work/.github/scripts"
74+ printf ' noop\n' > " $stale_noop /state"
75+ printf ' %s\n' " $main_oid " > " $stale_noop /base.sha"
76+ cp " $apply " " $verify_base " " $git_fixture /work/.github/scripts/"
77+ printf ' advanced\n' >> " $git_fixture /work/base"
78+ git -C " $git_fixture /work" commit -am advanced > /dev/null
79+ git -C " $git_fixture /work" push origin main > /dev/null
80+ if (cd " $git_fixture /work" && .github/scripts/apply-dependency-update npm " $stale_noop " ) \
81+ > " $test_root /stale-noop.log" 2>&1 ; then
82+ echo " stale no-op artifact was accepted after origin/main advanced" >&2
83+ exit 1
84+ fi
85+ grep -Fq ' dependency artifact was generated from a different origin/main' \
86+ " $test_root /stale-noop.log"
87+
7288npm_fixture=$test_root /npm
7389mkdir -p " $npm_fixture "
7490cat > " $npm_fixture /package.json" << 'EOF '
You can’t perform that action at this time.
0 commit comments