#!/bin/bash set -euo pipefail IFS=$'\n\t' RELEASE_INDEX="$(cat .github/workflows/rust.yml | yq '.jobs.unix_like.steps[] | select(.name == "Release") | path | .[-1]')" cat .github/workflows/rust.yml | yq '.jobs.unix_like.steps['"${RELEASE_INDEX}"'].with.draft = false' | yq '.on = { "push": { "tags": ["v*"] } } ' | yq '.name = "Rust Tag"' > .github/workflows/rust-tag.yml