From 39dd9cecaf069630a38c5c734e9ffd4729f2accb Mon Sep 17 00:00:00 2001 From: Chris Mitchell Date: Mon, 3 Nov 2025 09:36:38 +1300 Subject: [PATCH 1/2] [PETOSS-829] Use app token for checkout This will ensure git commands run in that context --- .github/workflows/create-github-release.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-github-release.yml b/.github/workflows/create-github-release.yml index d9c708054..fb196be99 100644 --- a/.github/workflows/create-github-release.yml +++ b/.github/workflows/create-github-release.yml @@ -12,23 +12,24 @@ jobs: pull-requests: write steps: + - name: Get github app access token + id: get_access_token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.XERO_PUBLIC_APP_ID }} + private-key: ${{ secrets.XERO_PUBLIC_BOT_KEY }} + - name: Checkout Repository uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ steps.get_access_token.outputs.token }} - name: Set up Node environment uses: actions/setup-node@v4 with: node-version: 20 - - name: Get github app access token - id: get_access_token - uses: actions/create-github-app-token@v2 - with: - app-id: ${{ vars.XERO_PUBLIC_APP_ID }} - private-key: ${{ secrets.XERO_PUBLIC_BOT_KEY }} - - name: Perform release run: npx --package @semantic-release/exec semantic-release env: From dc1f64aae6ce324dfecaa6a12721f784be6a69ac Mon Sep 17 00:00:00 2001 From: Chris Mitchell Date: Mon, 3 Nov 2025 09:37:56 +1300 Subject: [PATCH 2/2] [PETOSS-829] Set git user and email in GHA --- scripts/update-version.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/update-version.sh b/scripts/update-version.sh index 183b31e12..896f405f9 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -3,6 +3,11 @@ versionNumber=${1:?Version number is required as first argument} branchName=${2:-master} +if [ "${GITHUB_ACTIONS:-}" = "true" ]; then + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" +fi + git checkout "$branchName" for file in xero*.yaml; do