Skip to content

Commit 581a304

Browse files
committed
fix(ci): Generate PR into caller branch for store-type updates.
Signed-off-by: spbsoluble <[email protected]>
1 parent b19462b commit 581a304

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/update-stores.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
repository: 'keyfactor/kfutil'
7070
sparse-checkout: |
7171
.github
72+
cmd
7273
path: './merge-folder/'
7374
token: ${{ secrets.V2BUILDTOKEN }}
7475
ref: '${{env.KFUTIL_ARG}}'
@@ -81,6 +82,7 @@ jobs:
8182
repository: 'keyfactor/kfutil'
8283
sparse-checkout: |
8384
.github
85+
cmd
8486
path: './merge-folder/'
8587
token: ${{ secrets.V2BUILDTOKEN }}
8688

@@ -102,11 +104,6 @@ jobs:
102104
working-directory: ./tools/store-type-merge
103105
run: |
104106
python main.py --repo-name ${{ env.KFUTIL_ARG }} --ref ${{ env.TARGET_REPO_BRANCH }}
105-
pwd
106-
ls -la
107-
ls -la ../
108-
ls -la ../../
109-
cp -f store_types.json ../../cmd/store_types.json
110107
env:
111108
GITHUB_TOKEN: ${{ secrets.V2BUILDTOKEN }}
112109

@@ -138,7 +135,10 @@ jobs:
138135
run: |
139136
echo "Saving original store_types.json as store_types.sav.json"
140137
cp -f ./tools/store-type-merge/store_types.json ./merge-folder/store_types.json
138+
mkdir -p ./merge-folder/cmd || true
141139
cp -f ./tools/store-type-merge/store_types.json ./merge-folder/cmd/store_types.json # this necessary?
140+
ls -la ./merge-folder/
141+
ls -la ./merge-folder/cmd/
142142
143143
# Diff the new json against the saved copy and set an UPDATE_FILE variable
144144
- name: Diff the results
@@ -159,7 +159,9 @@ jobs:
159159
env:
160160
GITHUB_TOKEN: ${{ secrets.SDK_SYNC_PAT }}
161161
with:
162-
add: store_types.json cmd/store_types.json --force
162+
add: |
163+
store_types.json
164+
./cmd/store_types.json --force
163165
message: Update store_types.json for ${{env.KFUTIL_ARG}}:${{env.TARGET_REPO_BRANCH}}
164166
author_name: Keyfactor
165167
author_email: [email protected]
@@ -172,7 +174,9 @@ jobs:
172174
env:
173175
GITHUB_TOKEN: ${{ secrets.SDK_SYNC_PAT }}
174176
with:
175-
add: store_types.json cmd/store_types.json --force
177+
add: |
178+
store_types.json
179+
./cmd/store_types.json --force
176180
message: Update store_types.json for ${{env.KFUTIL_ARG}}:${{env.TARGET_REPO_BRANCH}}
177181
author_name: Keyfactor
178182
author_email: [email protected]
@@ -187,7 +191,7 @@ jobs:
187191
console.log("Commit to ${{env.KFUTIL_ARG}} for PR")
188192
const owner = context.repo.owner;
189193
const repo = context.repo.repo;
190-
const baseBranch = 'main';
194+
const baseBranch = context.ref.replace('refs/heads/', 'main'); // Default base branch is main
191195
const newBranch = '${{env.KFUTIL_ARG}}';
192196
const response = await github.rest.pulls.create({
193197
owner,

0 commit comments

Comments
 (0)