diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index e5511f3..3fe7ed4 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -95,22 +95,21 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} REPOSITORY: ${{ github.repository }} - QUERY: repository:${{ github.repository }} is:pr is:merged ${{ github.sha }} + REF: ${{ github.ref }} SHA: ${{ github.sha }} uses: actions/github-script@v7 with: script: | const [owner, repo] = process.env.REPOSITORY.split('/'); - const items = await github.paginate(github.rest.search.issuesAndPullRequests, { - q: process.env.QUERY, + const ref = process.env.REF.replace(/^refs\/heads\//, ''); + const candidates = await github.paginate(github.rest.pulls.list, { + owner, + repo, + state: 'closed', + base: ref, }); let pr; - for (const item of items) { - const candidate = await github.rest.pulls.get({ - owner, - repo, - pull_number: item.number, - }); + for (const candidate of candidates) { if (candidate.data.merge_commit_sha === process.env.SHA) { pr = candidate; break; diff --git a/CHANGELOG.md b/CHANGELOG.md index b6ddc64..697b255 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - do not install the same version of Go twice in the go-test and go-check workflows - mark the Go update commits as breaking changes in the style of conventional commits +- removed usage of search API from the releaser workflow ### Fixed - do not mark prereleases or versions with build strings as latest in the releaser workflow