Skip to content

Commit 1bdef77

Browse files
fix(deps): update dependency jr200-labs/github-action-templates to shared-v0.1.20 (#93)
Co-authored-by: jr200-labs-cicd-bot[bot] <273732104+jr200-labs-cicd-bot[bot]@users.noreply.github.com>
1 parent 097b6c8 commit 1bdef77

2 files changed

Lines changed: 22 additions & 7 deletions

File tree

.github/.shared-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ref: shared-v0.1.19
1+
ref: shared-v0.1.20
22
workflows:
33
- hygiene
44
- node

scripts/sync-shared

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)