From c9bc3321887dc872dd2b0cce1af934b2498fe5d5 Mon Sep 17 00:00:00 2001 From: MUzairS15 Date: Wed, 3 Apr 2024 23:57:11 +0530 Subject: [PATCH] rename PROVIDER_TOKEN to MESHERY_TOKEN Signed-off-by: MUzairS15 --- .github/workflows/file-path-build-test.yml | 2 +- .github/workflows/url-upload-test.yml | 2 +- README.md | 4 ++-- action.yml | 10 +++++----- node-file-upload/index.js | 2 +- uploadApplicationFile.sh | 2 +- uploadApplicationUrl.sh | 2 +- workflow-templates/file-uploadTemplate.yaml | 2 +- workflow-templates/url-uploadTemplate.yaml | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/file-path-build-test.yml b/.github/workflows/file-path-build-test.yml index bfb6c11..52886e7 100644 --- a/.github/workflows/file-path-build-test.yml +++ b/.github/workflows/file-path-build-test.yml @@ -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" diff --git a/.github/workflows/url-upload-test.yml b/.github/workflows/url-upload-test.yml index 9e71205..1c6a3f4 100644 --- a/.github/workflows/url-upload-test.yml +++ b/.github/workflows/url-upload-test.yml @@ -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" diff --git a/README.md b/README.md index 3ad7af1..2ca8270 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ jobs: uses: layer5labs/MeshMap-Snapshot@v0.0.4 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/MeshMap-Snapshot@v0.0.4 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" diff --git a/action.yml b/action.yml index b074a58..65b4c80 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/node-file-upload/index.js b/node-file-upload/index.js index 384be03..ca33a2f 100644 --- a/node-file-upload/index.js +++ b/node-file-upload/index.js @@ -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) { diff --git a/uploadApplicationFile.sh b/uploadApplicationFile.sh index 9a2406a..2b6ac97 100755 --- a/uploadApplicationFile.sh +++ b/uploadApplicationFile.sh @@ -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" diff --git a/uploadApplicationUrl.sh b/uploadApplicationUrl.sh index 39ba77c..4309559 100755 --- a/uploadApplicationUrl.sh +++ b/uploadApplicationUrl.sh @@ -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" diff --git a/workflow-templates/file-uploadTemplate.yaml b/workflow-templates/file-uploadTemplate.yaml index b732978..369a14e 100644 --- a/workflow-templates/file-uploadTemplate.yaml +++ b/workflow-templates/file-uploadTemplate.yaml @@ -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 }} diff --git a/workflow-templates/url-uploadTemplate.yaml b/workflow-templates/url-uploadTemplate.yaml index 1ff48b4..bb364ea 100644 --- a/workflow-templates/url-uploadTemplate.yaml +++ b/workflow-templates/url-uploadTemplate.yaml @@ -33,7 +33,7 @@ jobs: uses: layer5labs/MeshMap-Snapshot@v0.2.4 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 }}