This is an automated email from the ASF dual-hosted git repository. robertlazarski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git
commit 2963c23a36d45fefd9f5355ff2504cc82729c00e Author: Robert Lazarski <[email protected]> AuthorDate: Wed Jul 1 08:48:08 2026 -1000 ci: harden Remove Snapshots step against silent failure From a Gemini CI review: `find ... | xargs rm -rf` masks a find failure (xargs exits 0 on empty stdin), and GNU xargs also runs `rm` once with no operands on empty input. Add `set -o pipefail` so a find failure fails the step, and `xargs -r` so rm is skipped when there is nothing to remove. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffa98b4c57..1b5c4a2fe7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,9 @@ jobs: - name: Build run: mvn -B -e -Papache-release -Dgpg.skip=true -Dmaven.compiler.release=${{ matrix.java }} verify - name: Remove Snapshots - run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf + run: | + set -o pipefail + find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 -r rm -rf site: name: Site runs-on: ubuntu-24.04 @@ -79,7 +81,9 @@ jobs: - name: Build run: mvn -B -e -Dmaven.test.skip=true -Dmaven.compiler.release=${{ env.BASE_JAVA_VERSION }} package site-deploy - name: Remove Snapshots - run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf + run: | + set -o pipefail + find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 -r rm -rf deploy: if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'apache/axis-axis2-java-core' name: Deploy @@ -112,4 +116,6 @@ jobs: NEXUS_USER: ${{ secrets.NEXUS_USER }} NEXUS_PW: ${{ secrets.NEXUS_PW }} - name: Remove Snapshots - run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf + run: | + set -o pipefail + find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 -r rm -rf
