From 7e72ad90f0041bed5986b632ec9c62eb97572d8c Mon Sep 17 00:00:00 2001 From: Angelos Kolaitis Date: Mon, 3 Jun 2024 09:28:12 +0300 Subject: [PATCH] Use a script to apply the strict patch (#453) * use a script to apply the strict patch --- .github/workflows/strict-integration.yaml | 6 ++---- .github/workflows/strict.yaml | 4 +--- build-scripts/patches/strict/apply | 10 ++++++++++ 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100755 build-scripts/patches/strict/apply diff --git a/.github/workflows/strict-integration.yaml b/.github/workflows/strict-integration.yaml index b424e6076..9371d0eff 100644 --- a/.github/workflows/strict-integration.yaml +++ b/.github/workflows/strict-integration.yaml @@ -10,7 +10,7 @@ on: permissions: contents: read - + jobs: build: name: Build @@ -32,9 +32,7 @@ jobs: sudo snap install snapcraft --classic - name: Apply strict patch run: | - git config --global user.email k8s-bot@canonical.com - git config --global user.name k8s-bot - git am ./build-scripts/patches/strict/*.patch + ./build-scripts/patches/strict/apply - name: Build snap run: | sg lxd -c 'snapcraft --use-lxd' diff --git a/.github/workflows/strict.yaml b/.github/workflows/strict.yaml index b112508d6..cf45dae93 100644 --- a/.github/workflows/strict.yaml +++ b/.github/workflows/strict.yaml @@ -52,9 +52,7 @@ jobs: - name: Apply strict patch run: | git checkout -b ${{ needs.prepare.outputs.strict }} - git config --global user.email k8s-bot@canonical.com - git config --global user.name k8s-bot - git am ./build-scripts/patches/strict/*.patch + ./build-scripts/patches/strict/apply - name: Push to ${{ needs.prepare.outputs.strict }} run: | git push origin --force ${{ needs.prepare.outputs.strict }} diff --git a/build-scripts/patches/strict/apply b/build-scripts/patches/strict/apply new file mode 100755 index 000000000..1729742e2 --- /dev/null +++ b/build-scripts/patches/strict/apply @@ -0,0 +1,10 @@ +#!/bin/bash -xe + +DIR="$(realpath "$(dirname "${0}")")" + +# Configure git author +git config user.email k8s-bot@canonical.com +git config user.name k8s-bot + +# Apply strict patch +git am "${DIR}/0001-Strict-patch.patch"