40
40
echo "head_sha=${head_sha}" >> $GITHUB_OUTPUT
41
41
echo "head_sha_short=${head_sha:0:7}" >> $GITHUB_OUTPUT
42
42
echo "PR ${pr_number}" >> $GITHUB_STEP_SUMMARY
43
- echo "PR SHA: ${head_sha}" >> $GITHUB_STEP_SUMMARY
44
- echo "PR SHA Short : ${head_sha:0:7 }" >> $GITHUB_STEP_SUMMARY
43
+ echo "PR SHA: ${head_sha:0:7 }" >> $GITHUB_STEP_SUMMARY
44
+ echo "PR SHA FULL : ${head_sha}" >> $GITHUB_STEP_SUMMARY
45
45
build_dev_helm_locker :
46
46
name : Build and push helm-locker
47
47
runs-on : ${{ github.repository == 'rancher/prometheus-federator' && format('runs-on,image=ubuntu22-full-x64,runner=4cpu-linux-x64,run-id={0}', github.run_id) || 'ubuntu-latest' }}
@@ -177,6 +177,7 @@ jobs:
177
177
name : Comment on PR with image details
178
178
runs-on : ${{ github.repository == 'rancher/prometheus-federator' && format('runs-on,image=ubuntu22-full-x64,runner=4cpu-linux-x64,run-id={0}', github.run_id) || 'ubuntu-latest' }}
179
179
needs :
180
+ - prepare_pr_info
180
181
- build_dev_helm_locker
181
182
- build_dev_helm_project_operator
182
183
- build_dev_prometheus_federator
@@ -189,6 +190,8 @@ jobs:
189
190
meta-helm-locker : ${{ needs.build_dev_helm_locker.outputs.tags }}
190
191
meta-helm-project-operator : ${{ needs.build_dev_helm_project_operator.outputs.tags }}
191
192
meta-prometheus-federator : ${{ needs.build_dev_prometheus_federator.outputs.tags }}
193
+ prNumber : ${{ github.event.inputs.pr_number }}
194
+ shortSha : ${{ needs.prepare_pr_info.outputs.head_sha_short }}
192
195
with :
193
196
script : |
194
197
const prNumber = context.payload.inputs.pr_number;
@@ -210,14 +213,31 @@ jobs:
210
213
}
211
214
];
212
215
213
- const prepareTags = (tags) => tags.split(' ').join('\`,\n \`')
216
+ const prepareContainerImageText = function(imageInfo) {
217
+ const rawTags = process.env[imageInfo.key];
218
+ const tags = rawTags.split(' ')
219
+ .map(tag => `\t- \`${tag}\``)
220
+ .join('\n');
221
+
222
+ return `- [**${imageInfo.name}**](${imageInfo.url}) - Tags:\n${tags}`;
223
+ }
214
224
const commentBody = images
215
- .map(image => `- **${image.name}**: [Link to image](${image.url}):\n Tags: \`${prepareTags(process.env[image.key])}\``)
216
- .join('\n\n');
217
-
225
+ .map(prepareContainerImageText)
226
+ .join('\n');
227
+
228
+ const helmDebugValues = `#### Helm Debug Values:
229
+ \`\`\`yaml
230
+ image:
231
+ pullPolicy: Always
232
+ registry: ghcr.io
233
+ repository: rancher/prometheus-federator
234
+ tag: pr-${process.env.prNumber}-${process.env.shortSha}
235
+ \`\`\`\n`;
236
+ const fullCommentBody = `${commentBody}\n\n${helmDebugValues}`;
237
+
218
238
github.rest.issues.createComment({
219
239
issue_number: prNumber,
220
240
owner: context.repo.owner,
221
241
repo: context.repo.repo,
222
- body: `### Images built for PR #${prNumber}:\n\n${commentBody }`
242
+ body: `### Images built for PR #${prNumber}:\n\n${fullCommentBody }`
223
243
});
0 commit comments