Skip to content

Commit

Permalink
rename PROVIDER_TOKEN to MESHERY_TOKEN
Browse files Browse the repository at this point in the history
Signed-off-by: MUzairS15 <[email protected]>
  • Loading branch information
MUzairS15 committed Apr 3, 2024
1 parent 2358505 commit c9bc332
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/file-path-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/url-upload-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
githubToken:
description: "Github PAT token"
required: true
providerToken:
mesheryToken:
description: "Meshery Authentication Provider Token"
required: true
prNumber:
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion node-file-upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion uploadApplicationFile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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 }}
Expand Down

0 comments on commit c9bc332

Please sign in to comment.