Skip to content

Commit 6e25b27

Browse files
[PETOSS-829] Use app token when running git commands (#771)
* [PETOSS-829] Use app token for checkout This will ensure git commands run in that context * [PETOSS-829] Set git user and email in GHA
1 parent 597e0c2 commit 6e25b27

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/create-github-release.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,24 @@ jobs:
1212
pull-requests: write
1313

1414
steps:
15+
- name: Get github app access token
16+
id: get_access_token
17+
uses: actions/create-github-app-token@v2
18+
with:
19+
app-id: ${{ vars.XERO_PUBLIC_APP_ID }}
20+
private-key: ${{ secrets.XERO_PUBLIC_BOT_KEY }}
21+
1522
- name: Checkout Repository
1623
uses: actions/checkout@v4
1724
with:
1825
fetch-depth: 0
26+
token: ${{ steps.get_access_token.outputs.token }}
1927

2028
- name: Set up Node environment
2129
uses: actions/setup-node@v4
2230
with:
2331
node-version: 20
2432

25-
- name: Get github app access token
26-
id: get_access_token
27-
uses: actions/create-github-app-token@v2
28-
with:
29-
app-id: ${{ vars.XERO_PUBLIC_APP_ID }}
30-
private-key: ${{ secrets.XERO_PUBLIC_BOT_KEY }}
31-
3233
- name: Perform release
3334
run: npx --package @semantic-release/exec semantic-release
3435
env:

scripts/update-version.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
versionNumber=${1:?Version number is required as first argument}
44
branchName=${2:-master}
55

6+
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
7+
git config --global user.name "GitHub Actions"
8+
git config --global user.email "[email protected]"
9+
fi
10+
611
git checkout "$branchName"
712

813
for file in xero*.yaml; do

0 commit comments

Comments
 (0)