26
26
if : github.event_name == 'repository_dispatch'
27
27
id : set-env-vars-from-payload
28
28
run : |
29
- echo "TARGET_REPO_BRANCH=${{ github.event.client_payload.targetRepo }}" | tee -a $GITHUB_ENV
29
+ echo "TARGET_REPO_BRANCH=${{ github.event.client_payload.targetRef }}" | tee -a $GITHUB_ENV
30
30
echo "KFUTIL_ARG=${{ github.event.client_payload.targetRepo }}" | tee -a $GITHUB_ENV
31
31
- name : Check Open PRs for Existing Branch
32
32
id : check-branch
41
41
repo,
42
42
state: "open"
43
43
});
44
- // Filter out ones matching the TARGET_REPO_BRANCH from payload (repository_dispatch) or input (workflow_dispatch)
45
- const filteredData = pulls.data.filter(item => item.head.ref === '${{ env.TARGET_REPO_BRANCH }}');
44
+ // Filter out ones matching the KFUTIL_ARG from payload (repository_dispatch) or input (workflow_dispatch)
45
+ const filteredData = pulls.data.filter(item => item.head.ref === '${{ env.KFUTIL_ARG }}'); // Look for an existing branch with the orchestrator repo name
46
46
const isBranch = (filteredData.length > 0)
47
47
if (isBranch) {
48
48
const {
56
56
}
57
57
console.log(`Branch exists?`)
58
58
console.log(filteredData.length > 0)
59
- console.log(`targetRepo: ${{env.TARGET_REPO_BRANCH }}`)
59
+ console.log(`targetRepo: ${{env.KFUTIL_ARG }}`)
60
60
- name : set env.PR_BRANCH value for jobs
61
61
run : |
62
62
echo "PR_BRANCH=${{steps.check-branch.outputs.PR_BRANCH}}" | tee -a $GITHUB_ENV
71
71
.github
72
72
path : ' ./merge-folder/'
73
73
token : ${{ secrets.SDK_SYNC_PAT }}
74
- ref : ' ${{env.TARGET_REPO_BRANCH }}'
74
+ ref : ' ${{env.KFUTIL_ARG }}'
75
75
76
76
# If the branch does not exist, first check out the main branch from kfutil.
77
77
- name : Check out main
@@ -155,11 +155,11 @@ jobs:
155
155
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
156
156
with :
157
157
add : store_types.json --force
158
- message : Update store_types.json for ${{env.TARGET_REPO_BRANCH}}
158
+ message : Update store_types.json for ${{env.KFUTIL_ARG}}:${{env. TARGET_REPO_BRANCH}}
159
159
author_name : Keyfactor
160
160
author_email : keyfactor@keyfactor.github.io
161
161
cwd : ' ./merge-folder/'
162
- new_branch : ${{env.TARGET_REPO_BRANCH }}
162
+ new_branch : ${{env.KFUTIL_ARG }}
163
163
164
164
- name : Add and Commit to existing branch
165
165
if : ${{ env.UPDATE_FILE == 'T' && env.PR_BRANCH == 'commit' }}
@@ -168,7 +168,7 @@ jobs:
168
168
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
169
169
with :
170
170
add : store_types.json --force
171
- message : Update store_types.json for ${{env.TARGET_REPO_BRANCH}}
171
+ message : Update store_types.json for ${{env.KFUTIL_ARG}}:${{env. TARGET_REPO_BRANCH}}
172
172
author_name : Keyfactor
173
173
author_email : keyfactor@keyfactor.github.io
174
174
cwd : ' ./merge-folder/'
@@ -178,20 +178,20 @@ jobs:
178
178
uses : actions/github-script@v6
179
179
with :
180
180
script : |
181
- console.log(`Created ${{env.TARGET_REPO_BRANCH }} `)
182
- console.log("Commit to ${{env.TARGET_REPO_BRANCH }} for PR")
181
+ console.log(`Created ${{env.KFUTIL_ARG }} `)
182
+ console.log("Commit to ${{env.KFUTIL_ARG }} for PR")
183
183
const owner = context.repo.owner;
184
184
const repo = context.repo.repo;
185
185
const baseBranch = 'main';
186
- const newBranch = '${{env.TARGET_REPO_BRANCH }}';
186
+ const newBranch = '${{env.KFUTIL_ARG }}';
187
187
const response = await github.rest.pulls.create({
188
188
owner,
189
189
repo,
190
- title: 'New Pull Request - ${{env.TARGET_REPO_BRANCH}}',
190
+ title: 'New Pull Request - ${{env.KFUTIL_ARG}}:${{env. TARGET_REPO_BRANCH}}',
191
191
head: newBranch,
192
192
base: baseBranch,
193
- body: 'The cert store update from ${{env.TARGET_REPO_BRANCH}} needs to be verified and merged if correct.',
193
+ body: 'The cert store update from ${{env.KFUTIL_ARG}}:${{env. TARGET_REPO_BRANCH}} needs to be verified and merged if correct.',
194
194
});
195
- console.log(`Pull request created: ${{env.TARGET_REPO_BRANCH}} : ${response.data.html_url}`);
195
+ console.log(`Pull request created: ${{env.KFUTIL_ARG}}:${{env. TARGET_REPO_BRANCH}} : ${response.data.html_url}`);
196
196
env :
197
197
GITHUB_TOKEN : ${{ secrets.SDK_SYNC_PAT }}
0 commit comments