Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename PROVIDER_TOKEN to MESHERY_TOKEN #95

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/file-path-build-test.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:
uses: ./action
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
providerToken: ${{ secrets.PROVIDER_TOKEN }}
mesheryToken: ${{ secrets.MESHERY_TOKEN }}
prNumber: ${{ env.PULL_NO }}
application_type: "Kubernetes Manifest"
filePath: "action/__tests__/manifest-test"
2 changes: 1 addition & 1 deletion .github/workflows/url-upload-test.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:
uses: ./action
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
providerToken: ${{ secrets.PROVIDER_TOKEN }}
mesheryToken: ${{ secrets.MESHERY_TOKEN }}
prNumber: ${{ env.PULL_NO }}
application_type: "Helm Chart"
application_url: "https://github.com/meshery/meshery.io/raw/master/charts/meshery-v0.6.86.tgz"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ jobs:
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.....
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: "Kubernetes Manifest" # your application type, could be any of three: "Kubernetes Manifest", "Docker Compose", "Helm Chart"
filePath: "action/__tests__/manifest-test" # relative file-path from the root directory in the github-runner env, you might require to checkout the repository as described in step 2
@@ -76,7 +76,7 @@ jobs:
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.....
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: "Helm Chart" # your application type, could be any of three: "Kubernetes Manifest", "Docker Compose", "Helm Chart"
application_url: "https://github.com/meshery/meshery.io/raw/master/charts/meshery-v0.6.88.tgz"
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ inputs:
githubToken:
description: "Github PAT token"
required: true
providerToken:
mesheryToken:
description: "Meshery Authentication Provider Token"
required: true
prNumber:
@@ -75,14 +75,14 @@ runs:
shell: bash
- run: |
echo "Uploading using application file"
AppId=$(MESHERY_SERVER_BASE_URL="https://playground.meshery.io" UPLOAD_TYPE="${{inputs.application_type}}" PROVIDER_TOKEN=${{ inputs.providerToken }} ./action/uploadApplicationFile.sh)
AppId=$(MESHERY_SERVER_BASE_URL="https://playground.meshery.io" UPLOAD_TYPE="${{inputs.application_type}}" MESHERY_TOKEN=${{ inputs.mesheryToken }} ./action/uploadApplicationFile.sh)
AppId=$(echo "$AppId" | sed 's/"//g')
echo "APPLICATION_ID=$AppId" >> $GITHUB_ENV
if: ${{ inputs.filePath && !inputs.designID }}
shell: bash
- run: |
echo "Uploading using application url"
AppId=$(MESHERY_SERVER_BASE_URL="https://playground.meshery.io" UPLOAD_TYPE="${{inputs.application_type}}" PROVIDER_TOKEN=${{ inputs.providerToken }} UPLOAD_URL=${{ inputs.application_url }} ./action/uploadApplicationUrl.sh)
AppId=$(MESHERY_SERVER_BASE_URL="https://playground.meshery.io" UPLOAD_TYPE="${{inputs.application_type}}" MESHERY_TOKEN=${{ inputs.mesheryToken }} UPLOAD_URL=${{ inputs.application_url }} ./action/uploadApplicationUrl.sh)
AppId=$(echo "$AppId" | sed 's/"//g')
echo "APPLICATION_ID=$AppId" >> $GITHUB_ENV
if: ${{ inputs.application_url && !inputs.designID }}
@@ -104,7 +104,7 @@ runs:
# record: true
env:
GITHUB_TOKEN: ${{ inputs.githubToken }}
CYPRESS_token: ${{ inputs.providerToken }}
CYPRESS_token: ${{ inputs.mesheryToken }}
CYPRESS_releasetag: ${{env.tag}}
CYPRESS_applicationId: ${{ env.APPLICATION_ID }}
# CYPRESS_RECORD_KEY: ${{ inputs.cypressRecordKey }}
@@ -131,7 +131,7 @@ runs:
shell: bash
- id: outputurl
run: |
PROVIDER_TOKEN=${{inputs.providerToken}} assetLocation=${{ inputs.assetLocation }} node node-file-upload/index.js > __fileResponse.txt
MESHERY_TOKEN=${{inputs.mesheryToken}} assetLocation=${{ inputs.assetLocation }} node node-file-upload/index.js > __fileResponse.txt
outputstr=$(head -n 1 __fileResponse.txt)
required_string="https"
echo $outputstr
2 changes: 1 addition & 1 deletion node-file-upload/index.js
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ fs.readdirSync(dirPath).forEach((fileName, index) => {

const headers = {
"Content-Type": "multipart/form-data",
Authorization: `Bearer ${process.env.PROVIDER_TOKEN}`,
Authorization: `Bearer ${process.env.MESHERY_TOKEN}`,
};

if (formData) {
2 changes: 1 addition & 1 deletion uploadApplicationFile.sh
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ curl "$MESHERY_SERVER_BASE_URL/api/pattern/$UPLOAD_TYPE" \
-H 'Accept: */*' \
-H 'Connection: close' \
-H 'Content-Type: text/plain;charset=UTF-8' \
-H "Cookie: meshery-provider=Meshery; token=$PROVIDER_TOKEN;" \
-H "Cookie: meshery-provider=Meshery; token=$MESHERY_TOKEN;" \
--data-raw "{\"save\":true, \"pattern_data\": {\"pattern_file\":$MESHERY_PATTERN_FILE}}" \
--compressed | jq ".[0].id"

2 changes: 1 addition & 1 deletion uploadApplicationUrl.sh
Original file line number Diff line number Diff line change
@@ -12,6 +12,6 @@ curl "$MESHERY_SERVER_BASE_URL/api/pattern/$UPLOAD_TYPE" \
-H 'Accept: */*' \
-H 'Connection: close' \
-H 'Content-Type: text/plain;charset=UTF-8' \
-H "Cookie: meshery-provider=Meshery; token=$PROVIDER_TOKEN;" \
-H "Cookie: meshery-provider=Meshery; token=$MESHERY_TOKEN;" \
--data-raw "{\"save\":true, \"url\": \"$UPLOAD_URL\"}" \
--compressed | jq ".[0].id"
2 changes: 1 addition & 1 deletion workflow-templates/file-uploadTemplate.yaml
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ jobs:
uses: ${GITHUB_REF/refs/tags//}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
providerToken: ${{ secrets.PROVIDER_TOKEN }}
mesheryToken: ${{ secrets.MESHERY_TOKEN }}
prNumber: ${{ env.PULL_NO }}
application_type: $ph_application_type
filePath: ${{ inputs.fileName == '' && '$ph_filePath' || inputs.fileName }}
2 changes: 1 addition & 1 deletion workflow-templates/url-uploadTemplate.yaml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ jobs:
uses: layer5labs/[email protected]
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
providerToken: ${{ secrets.PROVIDER_TOKEN }}
mesheryToken: ${{ secrets.MESHERY_TOKEN }}
prNumber: ${{ env.PULL_NO }}
application_type: $ph_application_type
application_url: ${{ inputs.fileURL == '' && '$ph_application_url' || inputs.fileURL }}
Loading