Skip to content

Commit 49f918c

Browse files
ci(workflows): avoid extra API call in update-stable-titles
Avoid the extra API read since the event payload already has what we need. The workflow currently calls `pulls.get()` before doing anything. For pull_request `opened` and `edited` events, all of what we need should already be available in `context.payload.pull_request`, Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent 6cc5761 commit 49f918c

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

.github/workflows/update-stable-titles.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ jobs:
3939
with:
4040
github-token: ${{ secrets.GITHUB_TOKEN }}
4141
script: |
42-
const { data: pr } = await github.rest.pulls.get({
43-
owner: context.repo.owner,
44-
repo: context.repo.repo,
45-
pull_number: context.issue.number,
46-
});
47-
42+
const pr = context.payload.pull_request;
4843
const baseBranch = pr.base.ref;
4944
const currentTitle = pr.title;
5045

0 commit comments

Comments
 (0)