mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
Revert "ci: Add downstream/xxx label based on github org membership"
This reverts commit 0475fad2ec.
When the downstream/* labels were added, the intent was for a
"downstream/foo" label to mean "this PR is important for foo". Hence we
had downstream/fedora, downstream/debian, …, a some time later
downstream/amutable. But the PR job started adding that label to all PRs,
even for cleanups and other things that are done by a person from the
company, but might not be directly related to the downstream product that
is being built. This dilutes the usefulness of the labels. Also, the
config in the CI job was only added for downstream/amutable, so one
company was more visible than others. If we filled this out for all
companies and projects, many PRs would have a whole list of lables, since
people can be affiliated with both a company and a distro, and some PRs
are done by multiple people in cooperation. But we don't actually care
about affiliations of authors that much. Let's just drop this.
This commit is contained in:
1 parent
2edf992e44
commit
6cdf9c9b46
1 file changed
-42
@@ -227,48 +227,6 @@ jobs:
|
||||
}
|
||||
}
|
||||
|
||||
- name: Label PR based on author's GitHub org membership
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
|
||||
if: startsWith(github.event_name, 'pull_request') && github.event.action != 'closed'
|
||||
with:
|
||||
script: |
|
||||
const orgLabels = {
|
||||
"amutable": "downstream/amutable",
|
||||
};
|
||||
|
||||
const author = context.payload.pull_request.user.login;
|
||||
|
||||
const labels = [];
|
||||
for (const [org, label] of Object.entries(orgLabels)) {
|
||||
/* The workflow token is not a member of these organizations, so
|
||||
* GitHub only reveals public memberships to it. Members have to
|
||||
* make their membership public to get the label. */
|
||||
try {
|
||||
await github.rest.orgs.checkPublicMembershipForUser({
|
||||
org: org,
|
||||
username: author,
|
||||
});
|
||||
labels.push(label);
|
||||
} catch (error) {
|
||||
if (error.status !== 404) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (labels.length == 0) {
|
||||
core.info(`${author} is not a public member of any listed organization`);
|
||||
} else if (process.env.SELF_TEST == "true") {
|
||||
core.info(`Would add ${labels.join(", ")}`);
|
||||
} else {
|
||||
await github.rest.issues.addLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: labels,
|
||||
});
|
||||
}
|
||||
|
||||
- name: Add please-review label on command in issue comment
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
|
||||
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/please-review')
|
||||
|
||||
Reference in new issue
Block a user