diff --git a/action.yml b/action.yml index b2ac29f..e5732ea 100644 --- a/action.yml +++ b/action.yml @@ -7,6 +7,9 @@ inputs: description: 'The your branches that you want to purge cache existing in jsDelivr' required: false default: 'latest' + jdtoken: + description: 'The jsDelivr API token to purge cache existing in jsDelivr' + required: true runs: using: 'composite' @@ -24,7 +27,8 @@ runs: WORKFLOWREF: ${{ github.workflow_ref }} CI_WORKSPACE_PATH: ${{ github.workspace }} CI_ACTION_PATH: ${{ github.action_path }} + JSDELIVR_TOKEN: ${{ inputs.jdtoken }} run: | - npm run ci -- --gh-token "$GITHUB_TOKEN" --repo "$REPO" --workflow-ref "$WORKFLOWREF" --branch "$BRANCHE" --ci-workspace-path "$CI_WORKSPACE_PATH" --ci-action-path "$CI_ACTION_PATH" + npm run ci -- --gh-token "$GITHUB_TOKEN" --repo "$REPO" --workflow-ref "$WORKFLOWREF" --branch "$BRANCHE" --ci-workspace-path "$CI_WORKSPACE_PATH" --ci-action-path "$CI_ACTION_PATH" --jd-token "$JSDELIVR_TOKEN" shell: bash working-directory: ${{ github.action_path }} \ No newline at end of file diff --git a/index.ts b/index.ts index 5543e4a..542e73a 100644 --- a/index.ts +++ b/index.ts @@ -21,7 +21,7 @@ Program.option('--debug', 'output extra debugging', false) .option('--branch ', 'A GitHub branch. eg: master', '') .option('--ci-workspace-path ', 'A path to the CI workspace.', '') .option('--ci-action-path ', 'A path to the CI action.', '') - .option('--should-use-api ', 'Should use GitHub API?', 'false') + .option('--jd-token ', 'jsDelivr token to purge', '') // Initialize Input of the options and export them. Program.parse() diff --git a/sources/types.ts b/sources/types.ts index 038646a..92811aa 100644 --- a/sources/types.ts +++ b/sources/types.ts @@ -7,6 +7,7 @@ export type ProgramOptionsRawType = { branch: string; ciWorkspacePath: string; ciActionPath: string; + jdToken: string; } export type ProgramOptionsType = { @@ -17,6 +18,7 @@ export type ProgramOptionsType = { branch: string; ciWorkspacePath: string; ciActionPath: string; + jdToken: string; } export type CDNStatusResponseType = {