Skip to content

Commit 3e518d1

Browse files
authored
Merge pull request #351 from VOVELEE/feature/remove-maintain
Remove maintain permissions
2 parents f680b35 + d5c75e8 commit 3e518d1

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ As seen above, we have two steps. One for a noop deploy, and one for a regular d
263263
| `unlock_trigger` | `false` | `.unlock` | The string to look for in comments as an IssueOps unlock trigger. Used for unlocking branch deployments. Example: ".unlock" |
264264
| `help_trigger` | `false` | `.help` | The string to look for in comments as an IssueOps help trigger. Example: ".help" |
265265
| `lock_info_alias` | `false` | `.wcid` | An alias or shortcut to get details about the current lock (if it exists) Example: ".info" - Hubbers will find the ".wcid" default helpful ("where can I deploy") |
266-
| `permissions` | `true` | `write,maintain,admin` | The allowed GitHub permissions an actor can have to invoke IssueOps commands - Example: "write,maintain,admin" |
266+
| `permissions` | `true` | `write,admin` | The allowed GitHub permissions an actor can have to invoke IssueOps commands - Example: "write,admin" |
267267
| `commit_verification` | `false` | `"false"` | Whether or not to enforce commit verification before a deployment can continue. Default is `"false"`. This input option is excellent to enforce tighter security controls on your deployments. |
268268
| `param_separator` | `false` | `\|` | The separator to use for parsing parameters in comments in deployment requests. Parameters will are saved as outputs and can be used in subsequent steps - See [Parameters](docs/parameters.md) for additional details |
269269
| `global_lock_flag` | `false` | `--global` | The flag to pass into the lock command to lock all environments. Example: "--global" |

__tests__/functions/help.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const defaultInputs = {
4444
skipReviews: '',
4545
draft_permitted_targets: '',
4646
admins: 'false',
47-
permissions: ['write', 'admin', 'maintain'],
47+
permissions: ['write', 'admin'],
4848
allow_sha_deployments: false,
4949
checks: 'all',
5050
commit_verification: true,
@@ -83,7 +83,7 @@ test('successfully calls help with non-defaults', async () => {
8383
skipReviews: 'development',
8484
draft_permitted_targets: 'development',
8585
admins: 'monalisa',
86-
permissions: ['write', 'admin', 'maintain'],
86+
permissions: ['write', 'admin'],
8787
allow_sha_deployments: true,
8888
checks: ['test,build,security'],
8989
ignored_checks: ['lint', 'format'],
@@ -121,7 +121,7 @@ test('successfully calls help with non-defaults again', async () => {
121121
skipReviews: 'development',
122122
draft_permitted_targets: 'development',
123123
admins: 'monalisa',
124-
permissions: ['write', 'admin', 'maintain'],
124+
permissions: ['write', 'admin'],
125125
allow_sha_deployments: false,
126126
checks: 'required',
127127
ignored_checks: ['lint'],
@@ -171,7 +171,7 @@ test('successfully calls help with non-defaults and unknown update_branch settin
171171
skipReviews: 'development',
172172
draft_permitted_targets: 'development',
173173
admins: 'monalisa',
174-
permissions: ['write', 'admin', 'maintain'],
174+
permissions: ['write', 'admin'],
175175
allow_sha_deployments: false,
176176
checks: 'required',
177177
ignored_checks: ['lint'],

__tests__/functions/prechecks.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ beforeEach(() => {
2525
jest.spyOn(core, 'warning').mockImplementation(() => {})
2626
jest.spyOn(core, 'setOutput').mockImplementation(() => {})
2727
jest.spyOn(core, 'saveState').mockImplementation(() => {})
28-
process.env.INPUT_PERMISSIONS = 'admin,write,maintain'
28+
process.env.INPUT_PERMISSIONS = 'admin,write'
2929

3030
baseCommitWithOid = {
3131
nodes: [
@@ -57,7 +57,7 @@ beforeEach(() => {
5757
skipReviews: '',
5858
draft_permitted_targets: '',
5959
checks: 'all',
60-
permissions: ['admin', 'write', 'maintain'],
60+
permissions: ['admin', 'write'],
6161
commit_verification: false,
6262
ignored_checks: []
6363
}
@@ -857,7 +857,7 @@ test('runs prechecks and fails due to bad user permissions', async () => {
857857
.mockReturnValueOnce({data: {permission: 'read'}, status: 200})
858858
expect(await prechecks(context, octokit, data)).toStrictEqual({
859859
message:
860-
'👋 @monalisa, that command requires the following permission(s): `admin/write/maintain`\n\nYour current permissions: `read`',
860+
'👋 @monalisa, that command requires the following permission(s): `admin/write`\n\nYour current permissions: `read`',
861861
status: false
862862
})
863863
})

__tests__/functions/valid-permissions.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ const setOutputMock = jest.spyOn(core, 'setOutput')
55

66
var octokit
77
var context
8-
var permissions = ['write', 'maintain', 'admin']
8+
var permissions = ['write', 'admin']
99

1010
beforeEach(() => {
1111
jest.clearAllMocks()
1212
jest.spyOn(core, 'setOutput').mockImplementation(() => {})
13-
process.env.INPUT_PERMISSIONS = 'write,maintain,admin'
13+
process.env.INPUT_PERMISSIONS = 'write,admin'
1414

1515
context = {
1616
actor: 'monalisa'
@@ -46,7 +46,7 @@ test('determines that a user has does not valid permissions to invoke the Action
4646
})
4747

4848
expect(await validPermissions(octokit, context, permissions)).toEqual(
49-
'👋 @monalisa, that command requires the following permission(s): `write/maintain/admin`\n\nYour current permissions: `read`'
49+
'👋 @monalisa, that command requires the following permission(s): `write/admin`\n\nYour current permissions: `read`'
5050
)
5151
expect(setOutputMock).toHaveBeenCalledWith('actor', 'monalisa')
5252
})

action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ inputs:
6666
required: false
6767
default: ".wcid"
6868
permissions:
69-
description: 'The allowed GitHub permissions an actor can have to invoke IssueOps commands - Example: "write,maintain,admin"'
69+
description: 'The allowed GitHub permissions an actor can have to invoke IssueOps commands - Example: "write,admin"'
7070
required: true
71-
default: "write,maintain,admin"
71+
default: "write,admin"
7272
commit_verification:
7373
description: 'Whether or not to enforce commit verification before a deployment can continue. Default is "false"'
7474
required: false

0 commit comments

Comments
 (0)