Skip to content

feat: add ci-helm

feat: add ci-helm #3

Workflow file for this run

name: Pull request - Continuous Integration
on:
pull_request:
branches: [main]
jobs:
ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
secrets:
oci-registry-password: ${{ secrets.GHCR_PAT_TOKEN }}
update-pr:
if: ${{ needs.ci.outputs.built-images }}
name: Update Pull Request
runs-on: "ubuntu-latest"
needs: ci
permissions:
pull-requests: write
issues: write
steps:
- id: get-comment-built-images
uses: actions/github-script@v6.4.1
with:
script: |
const builtImagesOutput = `${{ needs.ci.outputs.built-images }}`;
try {
builtImages = JSON.parse(builtImagesOutput);
} catch (error) {
throw new Error(`"built-images" output is not a valid JSON: ${error}`);
}
if (typeof builtImages !== 'object') {
core.setFailed('Given "built-images" output is not an object.');
return;
}
const commentMessage = Object.values(builtImages).map(({name,images}) => {
const imagesToPull = images.map(image => `\`\`\`\ndocker pull ${image}\n\`\`\``).join("\n");
return `### ${name}\n${imagesToPull}`;
}).join("\n");
if(commentMessage.length){
core.setOutput(
'comment-body',
commentMessage + "\n\nOnce the Pull Request gets validated, these(s) image(s) will automatically be deleted."
);
} else {
core.setOutput('comment-body','No images have been built.');
}
- uses: hoverkraft-tech/ci-github-common/actions/create-or-update-comment@0.4.3
with:
title: "Images have been built :sparkles: !"
body: |
${{ steps.get-comment-built-images.outputs.comment-body }}
reactions: "rocket"