@@ -162,14 +162,25 @@ is_gat_commitlint_job() {
162162 yq -e ' .jobs.commitlint.uses == "jr200-labs/github-action-templates/.github/workflows/lint_commits.yaml@master"' " $workflow_file " > /dev/null 2>&1
163163}
164164
165- cleanup_duplicate_workflow_commitlint () {
166- has_resolved_workflow commitlint || return 0
165+ is_gat_lint_pr_metadata_job () {
166+ local workflow_file=" $1 "
167+ [ -f " $workflow_file " ] || return 1
167168
169+ yq -e ' .jobs."lint-pr-metadata".uses == "jr200-labs/github-action-templates/.github/workflows/lint_pr_metadata.yaml@master"' " $workflow_file " > /dev/null 2>&1
170+ }
171+
172+ cleanup_duplicate_workflow_hygiene_jobs () {
168173 local ci_file=" ${WORKFLOWS_DIR} /ci.yaml"
169- is_gat_commitlint_job " $ci_file " || return 0
170174
171- yq -i ' del(.jobs.commitlint)' " $ci_file "
172- echo " updated: ${ci_file} removed duplicate commitlint job"
175+ if has_resolved_workflow commitlint && is_gat_commitlint_job " $ci_file " ; then
176+ yq -i ' del(.jobs.commitlint)' " $ci_file "
177+ echo " updated: ${ci_file} removed duplicate commitlint job"
178+ fi
179+
180+ if has_resolved_workflow lint-pr-metadata && is_gat_lint_pr_metadata_job " $ci_file " ; then
181+ yq -i ' del(.jobs."lint-pr-metadata")' " $ci_file "
182+ echo " updated: ${ci_file} removed duplicate lint-pr-metadata job"
183+ fi
173184}
174185
175186# Resolve groups to a deduped, sorted list of workflow names.
@@ -223,7 +234,7 @@ case "$MODE" in
223234 [ -f " .githooks/commit-msg" ] && chmod +x " .githooks/commit-msg"
224235 [ -f " .githooks/lint-message-text.sh" ] && chmod +x " .githooks/lint-message-text.sh"
225236 cleanup_legacy_commitlint
226- cleanup_duplicate_workflow_commitlint
237+ cleanup_duplicate_workflow_hygiene_jobs
227238 ensure_git_hooks_path
228239 if [ " $MODE " = " bootstrap" ]; then
229240 fetch " scripts/sync-shared" " scripts/sync-shared" || warn " fetch self failed"
@@ -278,6 +289,10 @@ case "$MODE" in
278289 echo " drift: ${WORKFLOWS_DIR} /ci.yaml has duplicate commitlint job; run ./scripts/sync-shared"
279290 rc=1
280291 fi
292+ if has_resolved_workflow lint-pr-metadata && is_gat_lint_pr_metadata_job " ${WORKFLOWS_DIR} /ci.yaml" ; then
293+ echo " drift: ${WORKFLOWS_DIR} /ci.yaml has duplicate lint-pr-metadata job; run ./scripts/sync-shared"
294+ rc=1
295+ fi
281296 # Surface unexpected on-disk workflows that aren't part of the resolved set.
282297 for f in " $WORKFLOWS_DIR " /* .yaml; do
283298 [ -f " $f " ] || continue
0 commit comments