Minor adjustments
Signed-off-by: Francesco Saltori <francescosaltori@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
Fixed bug in `publish:github` action that didn't permit to add users as collaborators.
|
||||
This fix required changing the way parameters are passed to the action.
|
||||
In order to add a team as collaborator, now you must use the `team` field instead of `user`.
|
||||
In order to add a team as collaborator, now you must use the `team` field instead of `username`.
|
||||
In order to add a user as collaborator, you must use the `user` field.
|
||||
|
||||
It's still possible to use the field `username` but is deprecated in favor of `team`.
|
||||
|
||||
@@ -355,7 +355,7 @@ export function createPublishGithubAction(options: {
|
||||
});
|
||||
} else if ('username' in collaborator) {
|
||||
ctx.logger.warn(
|
||||
'The field `username` is deprecated in favor of `team`',
|
||||
'The field `username` is deprecated in favor of `team` and will be removed in the future.',
|
||||
);
|
||||
await client.rest.teams.addOrUpdateRepoPermissionsInOrg({
|
||||
org: owner,
|
||||
@@ -447,20 +447,7 @@ export function createPublishGithubAction(options: {
|
||||
}
|
||||
|
||||
function extractCollaboratorName(
|
||||
collaborator:
|
||||
| {
|
||||
user: string;
|
||||
access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
|
||||
}
|
||||
| {
|
||||
team: string;
|
||||
access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
|
||||
}
|
||||
| {
|
||||
/** @deprecated This field is deprecated in favor of team */
|
||||
username: string;
|
||||
access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
|
||||
},
|
||||
collaborator: { user: string } | { team: string } | { username: string },
|
||||
) {
|
||||
if ('username' in collaborator) return collaborator.username;
|
||||
if ('user' in collaborator) return collaborator.user;
|
||||
|
||||
Reference in New Issue
Block a user