opentdf / platform

Persistent data centric security that extends owner control wherever data travels
BSD 3-Clause Clear License
19 stars 11 forks source link

CI: job to check PR issue association should allow `relates to` association that is non-closing #1333

Open jakedoublev opened 3 months ago

jakedoublev commented 3 months ago

https://github.com/orgs/community/discussions/66741

We should update our GHA to allow PR issue relation without closing association via fixes/closes/resolves to promote small, tracked PRs with a passing CI pipeline.

suchak1 commented 3 months ago

Here's a preliminary regex to use instead using the github api to check if an issue is linked. Use the GHA context to dynamically replace the org and repo name in the regex.

^((relates to)|(fixes)|(resolves)|(closes)):?(\s+)?https:\/\/github\.com\/opentdf\/platform\/issues\/\d+$

Test cases:

// PASS: no colon
fixes https://github.com/opentdf/platform/issues/1332
// PASS: one whitespace char
resolves: https://github.com/opentdf/platform/issues/1335
// PASS: multiple whitespace chars
relates to:  https://github.com/opentdf/platform/issues/1335
// PASS: no space
relates to:https://github.com/opentdf/platform/issues/1335
// FAIL: no https, no issues plural
http://github.com/opentdf/platform/issue/1332