Skip to content

Commit

Permalink
Merge pull request #351 from VOVELEE/feature/remove-maintain
Browse files Browse the repository at this point in the history
Remove maintain permissions
  • Loading branch information
GrantBirki authored Jan 8, 2025
2 parents f680b35 + d5c75e8 commit 3e518d1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ As seen above, we have two steps. One for a noop deploy, and one for a regular d
| `unlock_trigger` | `false` | `.unlock` | The string to look for in comments as an IssueOps unlock trigger. Used for unlocking branch deployments. Example: ".unlock" |
| `help_trigger` | `false` | `.help` | The string to look for in comments as an IssueOps help trigger. Example: ".help" |
| `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") |
| `permissions` | `true` | `write,maintain,admin` | The allowed GitHub permissions an actor can have to invoke IssueOps commands - Example: "write,maintain,admin" |
| `permissions` | `true` | `write,admin` | The allowed GitHub permissions an actor can have to invoke IssueOps commands - Example: "write,admin" |
| `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. |
| `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 |
| `global_lock_flag` | `false` | `--global` | The flag to pass into the lock command to lock all environments. Example: "--global" |
Expand Down
8 changes: 4 additions & 4 deletions __tests__/functions/help.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const defaultInputs = {
skipReviews: '',
draft_permitted_targets: '',
admins: 'false',
permissions: ['write', 'admin', 'maintain'],
permissions: ['write', 'admin'],
allow_sha_deployments: false,
checks: 'all',
commit_verification: true,
Expand Down Expand Up @@ -83,7 +83,7 @@ test('successfully calls help with non-defaults', async () => {
skipReviews: 'development',
draft_permitted_targets: 'development',
admins: 'monalisa',
permissions: ['write', 'admin', 'maintain'],
permissions: ['write', 'admin'],
allow_sha_deployments: true,
checks: ['test,build,security'],
ignored_checks: ['lint', 'format'],
Expand Down Expand Up @@ -121,7 +121,7 @@ test('successfully calls help with non-defaults again', async () => {
skipReviews: 'development',
draft_permitted_targets: 'development',
admins: 'monalisa',
permissions: ['write', 'admin', 'maintain'],
permissions: ['write', 'admin'],
allow_sha_deployments: false,
checks: 'required',
ignored_checks: ['lint'],
Expand Down Expand Up @@ -171,7 +171,7 @@ test('successfully calls help with non-defaults and unknown update_branch settin
skipReviews: 'development',
draft_permitted_targets: 'development',
admins: 'monalisa',
permissions: ['write', 'admin', 'maintain'],
permissions: ['write', 'admin'],
allow_sha_deployments: false,
checks: 'required',
ignored_checks: ['lint'],
Expand Down
6 changes: 3 additions & 3 deletions __tests__/functions/prechecks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ beforeEach(() => {
jest.spyOn(core, 'warning').mockImplementation(() => {})
jest.spyOn(core, 'setOutput').mockImplementation(() => {})
jest.spyOn(core, 'saveState').mockImplementation(() => {})
process.env.INPUT_PERMISSIONS = 'admin,write,maintain'
process.env.INPUT_PERMISSIONS = 'admin,write'

baseCommitWithOid = {
nodes: [
Expand Down Expand Up @@ -57,7 +57,7 @@ beforeEach(() => {
skipReviews: '',
draft_permitted_targets: '',
checks: 'all',
permissions: ['admin', 'write', 'maintain'],
permissions: ['admin', 'write'],
commit_verification: false,
ignored_checks: []
}
Expand Down Expand Up @@ -857,7 +857,7 @@ test('runs prechecks and fails due to bad user permissions', async () => {
.mockReturnValueOnce({data: {permission: 'read'}, status: 200})
expect(await prechecks(context, octokit, data)).toStrictEqual({
message:
'👋 @monalisa, that command requires the following permission(s): `admin/write/maintain`\n\nYour current permissions: `read`',
'👋 @monalisa, that command requires the following permission(s): `admin/write`\n\nYour current permissions: `read`',
status: false
})
})
Expand Down
6 changes: 3 additions & 3 deletions __tests__/functions/valid-permissions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const setOutputMock = jest.spyOn(core, 'setOutput')

var octokit
var context
var permissions = ['write', 'maintain', 'admin']
var permissions = ['write', 'admin']

beforeEach(() => {
jest.clearAllMocks()
jest.spyOn(core, 'setOutput').mockImplementation(() => {})
process.env.INPUT_PERMISSIONS = 'write,maintain,admin'
process.env.INPUT_PERMISSIONS = 'write,admin'

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

expect(await validPermissions(octokit, context, permissions)).toEqual(
'👋 @monalisa, that command requires the following permission(s): `write/maintain/admin`\n\nYour current permissions: `read`'
'👋 @monalisa, that command requires the following permission(s): `write/admin`\n\nYour current permissions: `read`'
)
expect(setOutputMock).toHaveBeenCalledWith('actor', 'monalisa')
})
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ inputs:
required: false
default: ".wcid"
permissions:
description: 'The allowed GitHub permissions an actor can have to invoke IssueOps commands - Example: "write,maintain,admin"'
description: 'The allowed GitHub permissions an actor can have to invoke IssueOps commands - Example: "write,admin"'
required: true
default: "write,maintain,admin"
default: "write,admin"
commit_verification:
description: 'Whether or not to enforce commit verification before a deployment can continue. Default is "false"'
required: false
Expand Down

0 comments on commit 3e518d1

Please sign in to comment.