From c443e1371dafa3456534101646ed73834ce8ecfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20H=C3=B6gberg?= Date: Thu, 11 Jan 2024 14:44:05 +0100 Subject: [PATCH] update deprecated urls & rename source input --- README.md | 2 +- action.yml | 2 +- dist/index.js | 6 +++--- src/index.ts | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6325bd6..a2b7164 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ You can simply refer to this GitHub action in any GitHub workflow.: - name: Tag BPMN Models uses: apendo-c8/tag-bpmn-models@v1 with: - source: 'Project Id' + project_id: 'Project Id' tag: 'Tag name (${{ github.ref_name }} will reference the latest pushed tag or branch)' client_id: 'Camunda Modeler API client id' client_secret: 'Camunda Modeler API client secret' diff --git a/action.yml b/action.yml index 14b3491..f4333c2 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ description: 'GitHub Action for automated tagging of BPMN models' author: "Kristoffer Högberg" inputs: - source: + project_id: description: 'Camunda modeler project id' required: true tag: diff --git a/dist/index.js b/dist/index.js index e7a2ab7..3204ce0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13,7 +13,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); const core_1 = __nccwpck_require__(2186); const axios_1 = __importDefault(__nccwpck_require__(8757)); const TAG = (0, core_1.getInput)('tag'); -const SOURCE = (0, core_1.getInput)('source'); +const SOURCE = (0, core_1.getInput)('project_id'); const MODELER_CLIENT_ID = (0, core_1.getInput)('client_id'); const MODELER_CLIENT_SECRET = (0, core_1.getInput)('client_secret'); const getToken = async () => { @@ -47,7 +47,7 @@ const getToken = async () => { }; const getFileIdsByProjectId = async (token) => { try { - const urlMilestone = 'https://modeler.cloud.camunda.io/api/beta/files/search'; + const urlMilestone = 'https://modeler.cloud.camunda.io/api/v1/files/search'; // TODO: page can not be larger than 50? const body = { "filter": { @@ -67,7 +67,7 @@ const getFileIdsByProjectId = async (token) => { }; const setMilestone = async (token, fileId) => { try { - const urlMilestone = 'https://modeler.cloud.camunda.io/api/beta/milestones'; + const urlMilestone = 'https://modeler.cloud.camunda.io/api/v1/milestones'; const body = { "name": TAG, "fileId": fileId }; diff --git a/src/index.ts b/src/index.ts index f46671e..1f81928 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import {getInput, setFailed} from "@actions/core"; import axios from "axios"; const TAG = getInput('tag'); -const SOURCE = getInput('source'); +const SOURCE = getInput('project_id'); const MODELER_CLIENT_ID = getInput('client_id') const MODELER_CLIENT_SECRET = getInput('client_secret') @@ -43,7 +43,7 @@ const getToken = async () => { const getFileIdsByProjectId = async (token: string) => { try { - const urlMilestone = 'https://modeler.cloud.camunda.io/api/beta/files/search'; + const urlMilestone = 'https://modeler.cloud.camunda.io/api/v1/files/search'; // TODO: page can not be larger than 50? const body = { @@ -69,7 +69,7 @@ const getFileIdsByProjectId = async (token: string) => { const setMilestone = async (token: string, fileId: string) => { try { - const urlMilestone = 'https://modeler.cloud.camunda.io/api/beta/milestones'; + const urlMilestone = 'https://modeler.cloud.camunda.io/api/v1/milestones'; const body = { "name": TAG, "fileId": fileId