Skip to content

Commit

Permalink
Merge pull request #18 from infamous-riddles/feature/add-detailed-res…
Browse files Browse the repository at this point in the history
…trictions

Update project & add restrictions for branch protection
  • Loading branch information
pavlospt authored Apr 4, 2022
2 parents cc9c6e3 + 1a8f2dc commit be8be4f
Show file tree
Hide file tree
Showing 13 changed files with 17,599 additions and 29,529 deletions.
11 changes: 3 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"],
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"ecmaVersion": 13,
"sourceType": "module",
"project": "./tsconfig.json"
},
"ignorePatterns": ["**/__tests__/*.ts"],
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
Expand All @@ -16,13 +17,9 @@
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
Expand All @@ -32,15 +29,13 @@
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ protection rules on the main `feature` branch.
| `ALLOW-FORCE-PUSHES` | Set to true if you want to permit force pushes for all users with push access. |
| `ALLOW-DELETIONS` | Set to true if you want to allow users with push access to delete matching branches. |
| `INCLUDE-ADMINISTRATORS` | Set to true if you want to enforce all configured restrictions for administrators, as well. |
| `RESTRICTIONS-USERS` | List of users allowed to push on the protected branch. Defaults to `''`. |
| `RESTRICTIONS-TEAMS` | List of teams allowed to push on the protected branch. Defaults to `''`. |
| `RESTRICTIONS-APPS` | List of apps allowed to push on the protected branch. Defaults to `''`. |

A sample of rule branch creation can be found [here](.github/workflows/create.yml).

Expand Down
11 changes: 10 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ inputs:
INCLUDE-ADMINISTRATORS:
description: 'Set to true if you want to enforce all configured restrictions for administrators, as well.'
default: 'false'
RESTRICTIONS-USERS:
description: 'List of users allowed to push on the protected branch.'
default: ''
RESTRICTIONS-TEAMS:
description: 'List of teams allowed to push on the protected branch.'
default: ''
RESTRICTIONS-APPS:
description: 'List of apps allowed to push on the protected branch.'
default: ''

runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
Loading

0 comments on commit be8be4f

Please sign in to comment.