From ea5bf4c83a0a4f65e9fe5d47709c851fb4242a87 Mon Sep 17 00:00:00 2001 From: AzureMarker Date: Sun, 6 Jun 2021 19:29:23 -0400 Subject: [PATCH] Skip crate publishing if there have been no changes --- .github/workflows/publish.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c3661b6f26e..6639b84bb5d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,6 +33,12 @@ jobs: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} shell: bash run: | + export CHANGED=$(cargo workspaces changed --ignore-changes "**/Cargo.toml") + if [[ -z "$CHANGED" ]]; then + # Nothing has changed, so don't publish a new version + exit 0 + fi + git config --global user.email "runner@gha.local" git config --global user.name "Github Action" cargo workspaces -v version -ay --force '*' --include-merged-tags --no-git-commit --exact patch