Commit b18a11b
committed
Add a function to find the
To update the `/git-artifacts` comment when cascading
`git-artifacts-<arch>` runs are triggered, we need a way to get from the
commit SHA (which is part of the `check_run.completed` webhook) to the
corresponding PR comment ID.
Here, we introduce a function to do that, by using GitHub API's search
functionality. The commit SHA is given verbatim, which should be good
enough according to the documentation at
https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-by-commit-sha
Further, we make use of the text match metadata
(https://docs.github.com/en/rest/search/search#text-match-metadata) to
match the desired PR comment and to extract the PR comment ID.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>/git-artifacts PR comment for a given commit SHA1 parent f48a238 commit b18a11b
2 files changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
| |||
65 | 76 | | |
66 | 77 | | |
67 | 78 | | |
| 79 | + | |
68 | 80 | | |
69 | 81 | | |
70 | 82 | | |
| |||
0 commit comments