From e49d8c3810fb80f84a9f17bb8673c2c8c1fca785 Mon Sep 17 00:00:00 2001 From: Olivier Laborde Date: Thu, 29 Aug 2024 12:18:03 +0300 Subject: [PATCH 1/3] GRAL-4409 added issue auto-close workflow --- .github/workflows/auto-close-stale-issues.yml | 19 ++++++ src/wrf.js | 58 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 .github/workflows/auto-close-stale-issues.yml create mode 100644 src/wrf.js diff --git a/.github/workflows/auto-close-stale-issues.yml b/.github/workflows/auto-close-stale-issues.yml new file mode 100644 index 00000000..057064b4 --- /dev/null +++ b/.github/workflows/auto-close-stale-issues.yml @@ -0,0 +1,19 @@ +name: Auto-close stale issues + +on: + schedule: + - cron: "0 0 1 * *" # Runs the action on the first day of each month + +jobs: + close-stale-issues: + runs-on: ubuntu-latest + steps: + - name: Close stale issues + uses: actions/stale@v5 + with: + days-before-stale: 150 # 5 months + days-before-close: 30 # 30 days after marking stale (total of 6 months) + stale-issue-message: "This issue has been marked as stale due to inactivity. It will be closed in 30 days if no further activity occurs." + close-issue-message: "Closing this issue due to 6 months of inactivity." + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/wrf.js b/src/wrf.js new file mode 100644 index 00000000..0cd3d3c5 --- /dev/null +++ b/src/wrf.js @@ -0,0 +1,58 @@ +const pipedrive = require('../dist'); +const pdClient = pipedrive.ApiClient.instance; + +pdClient.authentications.api_key.apiKey = 'c9b1187544c64885b6d54db674778a4bba435b8a'; +const api = new pipedrive.DealsApi(); + +(async () => { + try { + const response = await api.getDeal(34); + + console.log(response); + } catch (e) { + console.error(e); + } +})(); + +(async () => { + try { + const response = await api.addDeal( + { + title: '2649 deal title', + value: 150000, + currency: 'EUR', + user_id: null, + person_id: null, + org_id: 1, + stage_id: 2, + status: 'open', + expected_close_date: '2022-03-11', + lost_reason: null, + visible_to: 1, + bb4f8f48c2b0a7d872558f1eb4bd75b50b68301f: 'Excelsior', + }, + ); + console.log(response); + } catch (err) { + const errorToLog = err.context?.body || err; + + console.log('Deal update failed', errorToLog); + } +})(); + +(async () => { + try { + const response = await api.updateDeal(34, + { + title: '2649-2 deal title', + bb4f8f48c2b0a7d872558f1eb4bd75b50b68301f: '0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144', + }, + ); + console.log(response); + } catch (err) { + const errorToLog = err.context?.body || err; + + console.log('Deal update failed', errorToLog); + } +})(); + From ad954e734d836ca599ad7c09f9fd0292b25e0550 Mon Sep 17 00:00:00 2001 From: Olivier Laborde Date: Thu, 29 Aug 2024 12:22:13 +0300 Subject: [PATCH 2/3] GRAL-4409 changed cron schedule --- .github/workflows/auto-close-stale-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-close-stale-issues.yml b/.github/workflows/auto-close-stale-issues.yml index 057064b4..ed77d9b4 100644 --- a/.github/workflows/auto-close-stale-issues.yml +++ b/.github/workflows/auto-close-stale-issues.yml @@ -2,7 +2,7 @@ name: Auto-close stale issues on: schedule: - - cron: "0 0 1 * *" # Runs the action on the first day of each month + - cron: "0 7 * * 0" # Runs the action on Sundays at 7am UTC jobs: close-stale-issues: From 465535a5f74c3842f5fc766156b4863008f9129a Mon Sep 17 00:00:00 2001 From: Olivier Laborde Date: Thu, 29 Aug 2024 12:50:18 +0300 Subject: [PATCH 3/3] GRAL-4409 removed file --- src/wrf.js | 58 ------------------------------------------------------ 1 file changed, 58 deletions(-) delete mode 100644 src/wrf.js diff --git a/src/wrf.js b/src/wrf.js deleted file mode 100644 index 0cd3d3c5..00000000 --- a/src/wrf.js +++ /dev/null @@ -1,58 +0,0 @@ -const pipedrive = require('../dist'); -const pdClient = pipedrive.ApiClient.instance; - -pdClient.authentications.api_key.apiKey = 'c9b1187544c64885b6d54db674778a4bba435b8a'; -const api = new pipedrive.DealsApi(); - -(async () => { - try { - const response = await api.getDeal(34); - - console.log(response); - } catch (e) { - console.error(e); - } -})(); - -(async () => { - try { - const response = await api.addDeal( - { - title: '2649 deal title', - value: 150000, - currency: 'EUR', - user_id: null, - person_id: null, - org_id: 1, - stage_id: 2, - status: 'open', - expected_close_date: '2022-03-11', - lost_reason: null, - visible_to: 1, - bb4f8f48c2b0a7d872558f1eb4bd75b50b68301f: 'Excelsior', - }, - ); - console.log(response); - } catch (err) { - const errorToLog = err.context?.body || err; - - console.log('Deal update failed', errorToLog); - } -})(); - -(async () => { - try { - const response = await api.updateDeal(34, - { - title: '2649-2 deal title', - bb4f8f48c2b0a7d872558f1eb4bd75b50b68301f: '0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144', - }, - ); - console.log(response); - } catch (err) { - const errorToLog = err.context?.body || err; - - console.log('Deal update failed', errorToLog); - } -})(); -