From 0a021418d040ebd341ec08fce44e43c87d2b48db Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Wed, 18 Sep 2024 10:08:06 -0600 Subject: [PATCH] ci: fix packaging patch check (#5713) Also: - simplify checkout logic to use local github main branch - add human-friendly job name and reduce redundant words --- .github/workflows/packaging-tests.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/packaging-tests.yml b/.github/workflows/packaging-tests.yml index 7d74aaf4cf7..3d998a7c6da 100644 --- a/.github/workflows/packaging-tests.yml +++ b/.github/workflows/packaging-tests.yml @@ -1,4 +1,4 @@ -name: Packaging Tests +name: Packaging on: pull_request: @@ -18,6 +18,7 @@ env: jobs: check-patches: + name: Check patches runs-on: ubuntu-24.04 steps: - name: Checkout @@ -25,6 +26,7 @@ jobs: with: # Fetch all branches for merging fetch-depth: 0 + ref: main - name: Prepare dependencies run: | sudo DEBIAN_FRONTEND=noninteractive apt-get update @@ -34,15 +36,18 @@ jobs: echo 'QUILT_PATCHES=debian/patches' >> ~/.quiltrc echo 'QUILT_SERIES=debian/patches/series' >> ~/.quiltrc - - name: 'Daily recipe: quilt patches apply successfully and tests run' + - name: Configure git and merge run: | git config user.name "GitHub Actions" git config user.email "actions@github.com" - git remote add upstream https://git.launchpad.net/cloud-init - git fetch upstream main - git checkout upstream/main git merge ${{ github.sha }} - test -f debian/patches/series || echo "no patches, skipping" && exit 0 + + - name: Quilt patches apply successfully and tests run + run: | + if test -f debian/patches/series; then + echo "no patches, skipping" + exit 0 + fi quilt push -a tox -e py3 quilt pop -a