From 32c27d48930e9f620626e83acfd923ad0a0c049e Mon Sep 17 00:00:00 2001 From: Konrad Szwarc Date: Wed, 5 Apr 2023 10:52:16 +0200 Subject: [PATCH] ci: use correct pull request urls in changelog (#215) --- .github/scripts/update-changelog.js | 4 ++-- .../workflows/dependency-update-changelog.yml | 4 ++-- CHANGELOG.md | 16 +++++++++++----- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/scripts/update-changelog.js b/.github/scripts/update-changelog.js index ad58239..5bf972d 100644 --- a/.github/scripts/update-changelog.js +++ b/.github/scripts/update-changelog.js @@ -1,6 +1,6 @@ const fs = require('fs'); -module.exports = (version, prUrl) => { +module.exports = (version, prNumber) => { const changelog = fs.readFileSync('CHANGELOG.md', 'utf8'); const changelogLines = changelog.split('\n'); const lastChangeIndex = changelogLines.findIndex((line) => line.startsWith('## [')); @@ -10,7 +10,7 @@ module.exports = (version, prUrl) => { ### Dependencies -- chore(deps): update dependencies ([details](${prUrl})) +- chore(deps): update dependencies ([details](https://github.com/KonradSzwarc/devscard/pull/${prNumber})) `.trim(); changelogLines.splice(lastChangeIndex, 0, textToAppend + '\n'); diff --git a/.github/workflows/dependency-update-changelog.yml b/.github/workflows/dependency-update-changelog.yml index 595c762..96b51d4 100644 --- a/.github/workflows/dependency-update-changelog.yml +++ b/.github/workflows/dependency-update-changelog.yml @@ -33,8 +33,8 @@ jobs: script: | const script = require('.github/scripts/update-changelog.js'); const version = '${{ steps.semvers.outputs.patch }}'; - const prUrl = '${{ github.event.pull_request.url }}'; + const prNumber = '${{ github.event.pull_request.number }}'; - script(version, prUrl); + script(version, prNumber); - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index cb49320..bcfd92b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,23 +2,29 @@ All notable changes to this project will be documented in this file. +## [0.1.4] - 2023-04-05 + +### Workflow + +- ci: use pull request URL instead of its API endpoint when generating changelog for dependency updates. + ## [0.1.3] - 2023-03-27 ### Dependencies -- chore(deps): update dependencies ([details](https://api.github.com/repos/KonradSzwarc/devscard/pulls/214)) +- chore(deps): update dependencies ([details](https://github.com/KonradSzwarc/devscard/pull/214)) ## [0.1.2] - 2023-03-24 ### Dependencies -- chore(deps): update dependencies ([details](https://api.github.com/repos/KonradSzwarc/devscard/pulls/212)) +- chore(deps): update dependencies ([details](https://github.com/KonradSzwarc/devscard/pull/212)) ## [0.1.1] - 2023-03-20 ### Dependencies -- chore(deps): update dependencies ([details](https://api.github.com/repos/KonradSzwarc/devscard/pulls/213)) +- chore(deps): update dependencies ([details](https://github.com/KonradSzwarc/devscard/pull/213)) ## [0.1.0] - 2023-03-13 @@ -30,13 +36,13 @@ All notable changes to this project will be documented in this file. ### Dependencies -- chore(deps): update dependencies ([details](https://api.github.com/repos/KonradSzwarc/devscard/pulls/209)) +- chore(deps): update dependencies ([details](https://github.com/KonradSzwarc/devscard/pull/209)) ## [0.0.5] - 2023-02-27 ### Dependencies -- chore(deps): update dependencies ([details](https://api.github.com/repos/KonradSzwarc/devscard/pulls/207)) +- chore(deps): update dependencies ([details](https://github.com/KonradSzwarc/devscard/pull/207)) ## [0.0.4] - 2023-02-22 diff --git a/package-lock.json b/package-lock.json index e054200..b69c373 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "devscard", - "version": "0.1.3", + "version": "0.1.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "devscard", - "version": "0.1.3", + "version": "0.1.4", "hasInstallScript": true, "dependencies": { "@floating-ui/dom": "1.2.5", diff --git a/package.json b/package.json index 5be98c6..7c44042 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "devscard", "description": "Template for creating a comprehensive virtual CV for developers.", - "version": "0.1.3", + "version": "0.1.4", "private": true, "engines": { "node": ">=14",