summaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2025-10-10 09:46:34 +0200
committerLinus Färnstrand <linus@mullvad.net>2025-10-13 10:49:45 +0200
commitaf0986983facaa2fab2ae9459468d4936811cb05 (patch)
tree9a0c223b5686f2aa3d3cd8d5b8fc6b93d8c25319 /.github
parent58f3ea2fba47c30e6297ba4194052db7427bfa30 (diff)
downloadmullvadvpn-af0986983facaa2fab2ae9459468d4936811cb05.tar.xz
mullvadvpn-af0986983facaa2fab2ae9459468d4936811cb05.zip
Count PR author as approving code in code owner check
If someone from team A changes code owned only by team A, the team has already approved the code from a code owner perspective. Someone else must still review the code, as always, but the code does not need code owner approval.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/code-owner-approval.yml9
1 files changed, 9 insertions, 0 deletions
diff --git a/.github/workflows/code-owner-approval.yml b/.github/workflows/code-owner-approval.yml
index a66b074210..256f626d3f 100644
--- a/.github/workflows/code-owner-approval.yml
+++ b/.github/workflows/code-owner-approval.yml
@@ -137,7 +137,16 @@ jobs:
// Set of teams that have approved this PR
const approvedTeams = new Set();
+ // Get array of github usernames that have approved the PR
const approvers = await getApprovers();
+
+ // PR author automatically counts as an approver. A code owner changing
+ // their own code does not need extra code owner approval. They still
+ // need the code reviewed, but that's not part of code ownership approval.
+ const prAuthor = context.payload.pull_request.user.login;
+ if (!approvers.includes(prAuthor)) {
+ approvers.push(prAuthor);
+ }
console.log(`👍 PR approved by the following accounts: ${approvers.join(', ')}`);
for (const approver of approvers) {