@@ -269,14 +269,19 @@ make_annotated_tag() {
269269 local msg=$3
270270 local wait=${4:- false}
271271
272- git -C $repo tag -f -a " $tag " -m " $msg "
273-
274- git -C $repo describe --tags --abbrev=0
275-
276272 if [ " $wait " == true ]; then
277- # Ensure creation date difference between tags - git does not sort with sub-second accuracy.
278- sleep 1
273+ # Give each successive waited tag a distinct, increasing creation date so tags
274+ # sort deterministically. git's creatordate has only 1-second resolution, so
275+ # rather than sleeping 1s per tag we inject a monotonically increasing committer
276+ # date (the annotated tag's tagger/creator date).
277+ _annotated_tag_seq=$(( ${_annotated_tag_seq:- 0} + 1 ))
278+ GIT_COMMITTER_DATE=" $( date -u -d " @$(( 946684800 + _annotated_tag_seq )) " " +%Y-%m-%d %H:%M:%S +0000" ) " \
279+ git -C $repo tag -f -a " $tag " -m " $msg "
280+ else
281+ git -C $repo tag -f -a " $tag " -m " $msg "
279282 fi
283+
284+ git -C $repo describe --tags --abbrev=0
280285}
281286
282287check_uri () {
@@ -783,6 +788,93 @@ check_uri_with_branch_filters_and_regex() {
783788 }" | ${resource_dir} /check | tee /dev/stderr
784789}
785790
791+ check_uri_with_tags () {
792+ jq -n " {
793+ source: {
794+ uri: $( echo $1 | jq -R .) ,
795+ version_type: \" tags\"
796+ }
797+ }" | ${resource_dir} /check | tee /dev/stderr
798+ }
799+
800+ check_uri_with_tags_filter () {
801+ local uri=$1
802+ local tag_filter=$2
803+ jq -n " {
804+ source: {
805+ uri: $( echo $uri | jq -R .) ,
806+ version_type: \" tags\" ,
807+ tag_filter: $( echo " $tag_filter " | jq -R .)
808+ }
809+ }" | ${resource_dir} /check | tee /dev/stderr
810+ }
811+
812+ check_uri_with_tags_filters () {
813+ local uri=$1
814+ shift
815+ jq -n " {
816+ source: {
817+ uri: $( echo $uri | jq -R .) ,
818+ version_type: \" tags\" ,
819+ tag_filters: $( echo " $@ " | jq -R ' . | split(" ")' )
820+ }
821+ }" | ${resource_dir} /check | tee /dev/stderr
822+ }
823+
824+ check_uri_with_tags_filter_and_filters () {
825+ local uri=$1
826+ local tag_filter=$2
827+ shift 2
828+ jq -n " {
829+ source: {
830+ uri: $( echo $uri | jq -R .) ,
831+ version_type: \" tags\" ,
832+ tag_filter: $( echo " $tag_filter " | jq -R .) ,
833+ tag_filters: $( echo " $@ " | jq -R ' . | split(" ")' )
834+ }
835+ }" | ${resource_dir} /check | tee /dev/stderr
836+ }
837+
838+ check_uri_with_tags_regex () {
839+ local uri=$1
840+ local tag_regex=$2
841+ jq -n " {
842+ source: {
843+ uri: $( echo $uri | jq -R .) ,
844+ version_type: \" tags\" ,
845+ tag_regex: $( echo " $tag_regex " | jq -R .)
846+ }
847+ }" | ${resource_dir} /check | tee /dev/stderr
848+ }
849+
850+ check_uri_with_tags_sort () {
851+ local uri=$1
852+ local tag_sort=$2
853+ jq -n " {
854+ source: {
855+ uri: $( echo $uri | jq -R .) ,
856+ version_type: \" tags\" ,
857+ tag_sort: $( echo " $tag_sort " | jq -R .)
858+ }
859+ }" | ${resource_dir} /check | tee /dev/stderr
860+ }
861+
862+ check_uri_with_tags_sort_from () {
863+ local uri=$1
864+ local tag_sort=$2
865+ local prev_tag=$3
866+ jq -n " {
867+ source: {
868+ uri: $( echo $uri | jq -R .) ,
869+ version_type: \" tags\" ,
870+ tag_sort: $( echo " $tag_sort " | jq -R .)
871+ },
872+ version: {
873+ tag: $( echo " $prev_tag " | jq -R .)
874+ }
875+ }" | ${resource_dir} /check | tee /dev/stderr
876+ }
877+
786878get_uri () {
787879 jq -n " {
788880 source: {
0 commit comments