diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f212066a3..0447c3f78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,9 @@ name: Release + on: - push: - branches: - - master + pull_request: + types: [closed] + jobs: check-next-version: runs-on: ubuntu-latest @@ -15,10 +16,13 @@ jobs: next_version: ${{ steps.versionCheck.outputs.next_version }} current_version: ${{ steps.versionCheck.outputs.current_version }} + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master' + steps: - uses: actions/checkout@v3 with: fetch-depth: 0 + ref: master - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 @@ -58,6 +62,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + ref: master - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 @@ -131,6 +136,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + ref: master - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 @@ -153,7 +159,7 @@ jobs: run: npm ci --ignore-scripts - name: Generate release notes - run: node ./node_modules/.bin/happy-release-notes --author=githubUsername > ./RELEASE_NOTES.md + run: node ./node_modules/.bin/happy-release-notes --author=githubUsername --authorUsername=${{ github.event.pull_request.user.login }} > ./RELEASE_NOTES.md - name: Create release id: create_release diff --git a/package-lock.json b/package-lock.json index 4f49f425f..51d9cc2ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "eslint-plugin-jsdoc": "^48.0.2", "eslint-plugin-json": "^3.1.0", "eslint-plugin-prettier": "^5.1.3", - "happy-conventional-commit": "^0.0.18", + "happy-conventional-commit": "^0.1.0", "husky": "^9.0.6", "prettier": "^3.2.4", "semver": "^7.3.5", @@ -5442,9 +5442,9 @@ "dev": true }, "node_modules/happy-conventional-commit": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/happy-conventional-commit/-/happy-conventional-commit-0.0.18.tgz", - "integrity": "sha512-5kX+DR8TeGk30gyxDZqeWiQZwGfMYJKK0QbYtb+/nk/EJmLJQxNWKUdNm9F1NFupGH8A+HoElgZ8IT0PC6W5Lg==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/happy-conventional-commit/-/happy-conventional-commit-0.1.0.tgz", + "integrity": "sha512-Eht1OLYEppVD29z7gbq8Ptnuv+707Zp7DepfaZoKPcUBwXIPhsCRyqNM5HcLpz/icFbo3N4n9jt9Qi+eZAuMGQ==", "dev": true, "dependencies": { "glob": "^10.3.10" diff --git a/package.json b/package.json index 98f68ad4a..a065de759 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "devDependencies": { "@types/he": "^1.1.2", "@types/node": "^16.11.7", - "happy-conventional-commit": "^0.0.18", + "happy-conventional-commit": "^0.1.0", "chalk": "^4.1.0", "@typescript-eslint/eslint-plugin": "^6.19.0", "@typescript-eslint/parser": "^6.19.0",