-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,47 @@ | ||
name: MeshMap Screenshot Service | ||
on: # rebuild any PRs and main branch changes | ||
'on': | ||
pull_request_target: | ||
types: [opened, synchronize, reopened] | ||
|
||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
workflow_call: | ||
inputs: | ||
fileName: | ||
fileName: | ||
description: Relative file path from the root directory | ||
required: true | ||
type: string | ||
outputs: | ||
resource_url: | ||
description: "The URL of the generated resource." | ||
description: The URL of the generated resource. | ||
value: ${{ jobs.MeshMapScreenshot.outputs.resource_url }} | ||
permissions: | ||
permissions: | ||
actions: read | ||
contents: write | ||
security-events: write | ||
statuses: write | ||
pull-requests: write | ||
id-token: write | ||
|
||
jobs: | ||
MeshMapScreenshot: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
resource_url: ${{ steps.test_result.outputs.resource_url }} | ||
steps: | ||
- name: Set PR number # To comment the final status on the Pull-request opened in any repository | ||
- name: Set PR number | ||
run: | | ||
export pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | ||
echo "PULL_NO=$pull_number" >> $GITHUB_ENV | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 #this step would go away | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: action | ||
repository: layer5labs/meshmap-snapshot | ||
- id: test_result | ||
uses: layer5labs/[email protected] | ||
uses: ${GITHUB_REF/refs/tags//} | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} # github's personal access token example: "ghp_...." | ||
providerToken: ${{ secrets.PROVIDER_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: $ph_application_type # your application type, could be any of three: "Kubernetes Manifest", "Docker Compose", "Helm Chart" | ||
filePath: ${{ inputs.fileName == '' && '$ph_filePath' || inputs.fileName }} # relative file-path from the root directory in the github-runner env, you might require to checkout the repository as described in step 2 | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
providerToken: ${{ secrets.PROVIDER_TOKEN }} | ||
prNumber: ${{ env.PULL_NO }} | ||
application_type: $ph_application_type | ||
filePath: ${{ inputs.fileName == '' && '$ph_filePath' || inputs.fileName }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
name: 'MeshMap Snapshot With URL-Upload' | ||
on: # rebuild any PRs and main branch changes | ||
name: MeshMap Snapshot With URL-Upload | ||
'on': | ||
pull_request_target: | ||
types: [opened, synchronize, reopened] | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
workflow_call: | ||
inputs: | ||
fileURL: | ||
fileURL: | ||
description: Remote public accessible file URL | ||
required: true | ||
type: string | ||
outputs: | ||
resource_url: | ||
description: "The URL of the generated resource." | ||
description: The URL of the generated resource. | ||
value: ${{ jobs.MeshMapScreenshot.outputs.resource_url }} | ||
|
||
jobs: | ||
MeshMapScreenshot: # make sure the action works on a clean machine without building | ||
MeshMapScreenshot: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
resource_url: ${{ steps.test_result.outputs.resource_url }} | ||
steps: | ||
- name: Set PR number # To comment the final status on the Pull-request opened in any repository | ||
- name: Set PR number | ||
run: | | ||
export pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | ||
echo "PULL_NO=$pull_number" >> $GITHUB_ENV | ||
- uses: actions/checkout@v3 #this step would go and would be no longer needed to be written | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: action | ||
repository: layer5labs/meshmap-snapshot | ||
- id: test_result | ||
uses: layer5labs/[email protected] | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} # github's personal access token example: "ghp_...." | ||
providerToken: ${{ secrets.PROVIDER_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: $ph_application_type # your application type, could be any of three: "Kubernetes Manifest", "Docker Compose", "Helm Chart" | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
providerToken: ${{ secrets.PROVIDER_TOKEN }} | ||
prNumber: ${{ env.PULL_NO }} | ||
application_type: $ph_application_type | ||
application_url: ${{ inputs.fileURL == '' && '$ph_application_url' || inputs.fileURL }} | ||
|
||
|
||
- uses: ${GITHUB_REF/refs/tags//} |