update kanvas.yml to generate snapshot #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Kanvas Screenshot Service | |
'on': | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
workflow_call: | |
workflow_dispatch: | |
inputs: | |
application_type: | |
description: Type of the application (e.g., Helm Chart, Kubernetes Manifest, Docker Compose) | |
type: string | |
default: "Helm Chart" | |
designID: | |
description: "The design uuid, example: 3c116d0a-49ea-4294-addc-d9ab34210662" | |
type: string | |
assetLocation: | |
description: The location of the snapshot url | |
type: string | |
skipComment: | |
description: Skip comment | |
type: boolean | |
prNumber: | |
description: PR number | |
type: string | |
default: "0" | |
permissions: | |
actions: read | |
contents: write | |
security-events: write | |
statuses: write | |
pull-requests: write | |
id-token: write | |
jobs: | |
KanvasScreenshot: | |
runs-on: ubuntu-24.04 | |
outputs: | |
resource_url: ${{ steps.test_result.outputs.resource_url }} | |
steps: | |
- name: Set PR number | |
run: | | |
export pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | |
echo "PULL_NO=$pull_number" >> $GITHUB_ENV | |
if [ "$pull_number" = "null" ]; then | |
echo "PULL_NO=${{ inputs.prNumber }}" >> $GITHUB_ENV | |
fi | |
echo "MESHERY_TOKEN=${{ secrets.MESHERY_TOKEN }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
path: action | |
repository: layer5labs/kanvas-snapshot | |
- id: test_result | |
uses: layer5labs/[email protected] | |
with: | |
githubToken: ${{ secrets.GITHUB_TOKEN }} # github's personal access token example: "ghp_...." | |
mesheryToken: ${{ secrets.MESHERY_TOKEN }} # Meshery Cloud Authentication token, signin to meshery-cloud to get one, example: ey..... | |
prNumber: ${{ env.PULL_NO }} # auto-filled from the above step | |
application_type: ${{ inputs.application_type }} # your application type, could be any of three: "Kubernetes Manifest", "Docker Compose", "Helm Chart" | |
assetLocation: ${{ inputs.assetLocation }} | |
designID: ${{ inputs.designID }} | |
filePath: ${{ env.PULL_NO == '0' && 'https://meshery.github.io/meshery.io/charts/meshery-v0.7.109.tgz' }} # relative file-path from the root directory in the github-runner env, you might require to checkout the repository as described in step 2 | |