| Copyright | (c) 2025 Bellroy Pty Ltd |
|---|---|
| License | BSD-3-Clause |
| Maintainer | Bellroy Tech Team <haskell@bellroy.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.Github.Actions.Permissions
Description
This module provides types for managing GitHub Actions permissions and access control. Permissions control what GitHub APIs and resources workflows and jobs can access.
You can set permissions at the workflow level (affecting all jobs) or at individual job levels. This follows the principle of least privilege by allowing you to grant only the specific permissions needed.
For more information about GitHub Actions permissions, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
Synopsis
- data Permissions
- data PermissionType
- data Permission
- gen :: MonadGen m => m Permissions
Documentation
data Permissions Source #
Overall permissions configuration for a workflow or job.
Permissions can be set globally (affecting all permission types) or individually for specific permission types.
Example usage:
import Language.Github.Actions.Permissions -- Grant read access to everything readOnlyPerms :: Permissions readOnlyPerms = ReadAll -- Grant specific permissions only customPerms :: Permissions customPerms = Custom $ Map.fromList [ (Contents, Read) , (PullRequests, Write) ]
Constructors
| NoPermissions | No permissions granted (empty object) |
| ReadAll | Read access to all permission types |
| WriteAll | Write access to all permission types |
| Custom (Map PermissionType Permission) | Custom permission mapping |
Instances
data PermissionType Source #
Types of permissions that can be granted to GitHub Actions workflows.
Each permission type corresponds to a specific area of GitHub functionality that workflows might need to access.
For more details about each permission type, see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
Constructors
| Actions | Manage GitHub Actions (e.g., cancel workflow runs) |
| Attestations | Create and verify attestations |
| Checks | Create and update check runs and suites |
| Contents | Read and write repository contents |
| Deployments | Create and manage deployments |
| IdToken | Request OIDC JWT ID tokens |
| Issues | Create and manage issues |
| Discussions | Create and manage discussions |
| Packages | Publish and manage packages |
| Pages | Deploy to GitHub Pages |
| PullRequests | Create and manage pull requests |
| RepositoryProjects | Manage repository projects |
| SecurityEvents | Read and write security events |
| Statuses | Create commit status checks |
Instances
| FromJSON PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions Methods parseJSON :: Value -> Parser PermissionType # parseJSONList :: Value -> Parser [PermissionType] # | |||||
| FromJSONKey PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions | |||||
| ToJSON PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions Methods toJSON :: PermissionType -> Value # toEncoding :: PermissionType -> Encoding # toJSONList :: [PermissionType] -> Value # toEncodingList :: [PermissionType] -> Encoding # omitField :: PermissionType -> Bool # | |||||
| ToJSONKey PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions | |||||
| Bounded PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions | |||||
| Enum PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions Methods succ :: PermissionType -> PermissionType # pred :: PermissionType -> PermissionType # toEnum :: Int -> PermissionType # fromEnum :: PermissionType -> Int # enumFrom :: PermissionType -> [PermissionType] # enumFromThen :: PermissionType -> PermissionType -> [PermissionType] # enumFromTo :: PermissionType -> PermissionType -> [PermissionType] # enumFromThenTo :: PermissionType -> PermissionType -> PermissionType -> [PermissionType] # | |||||
| Generic PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions Associated Types
Methods from :: PermissionType -> Rep PermissionType x # to :: Rep PermissionType x -> PermissionType # | |||||
| Show PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions Methods showsPrec :: Int -> PermissionType -> ShowS # show :: PermissionType -> String # showList :: [PermissionType] -> ShowS # | |||||
| Eq PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions Methods (==) :: PermissionType -> PermissionType -> Bool # (/=) :: PermissionType -> PermissionType -> Bool # | |||||
| Ord PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions Methods compare :: PermissionType -> PermissionType -> Ordering # (<) :: PermissionType -> PermissionType -> Bool # (<=) :: PermissionType -> PermissionType -> Bool # (>) :: PermissionType -> PermissionType -> Bool # (>=) :: PermissionType -> PermissionType -> Bool # max :: PermissionType -> PermissionType -> PermissionType # min :: PermissionType -> PermissionType -> PermissionType # | |||||
| type Rep PermissionType Source # | |||||
Defined in Language.Github.Actions.Permissions type Rep PermissionType = D1 ('MetaData "PermissionType" "Language.Github.Actions.Permissions" "github-actions-0.1.1.0-BjHhRMO6iQ17qdsNXwhDab" 'False) (((C1 ('MetaCons "Actions" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Attestations" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Checks" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Contents" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Deployments" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "IdToken" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Issues" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Discussions" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Packages" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Pages" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "PullRequests" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RepositoryProjects" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "SecurityEvents" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Statuses" 'PrefixI 'False) (U1 :: Type -> Type))))) | |||||
data Permission Source #
Permission levels that can be granted for each permission type.
Instances
| FromJSON Permission Source # | |||||
Defined in Language.Github.Actions.Permissions | |||||
| ToJSON Permission Source # | |||||
Defined in Language.Github.Actions.Permissions Methods toJSON :: Permission -> Value # toEncoding :: Permission -> Encoding # toJSONList :: [Permission] -> Value # toEncodingList :: [Permission] -> Encoding # omitField :: Permission -> Bool # | |||||
| Bounded Permission Source # | |||||
Defined in Language.Github.Actions.Permissions | |||||
| Enum Permission Source # | |||||
Defined in Language.Github.Actions.Permissions Methods succ :: Permission -> Permission # pred :: Permission -> Permission # toEnum :: Int -> Permission # fromEnum :: Permission -> Int # enumFrom :: Permission -> [Permission] # enumFromThen :: Permission -> Permission -> [Permission] # enumFromTo :: Permission -> Permission -> [Permission] # enumFromThenTo :: Permission -> Permission -> Permission -> [Permission] # | |||||
| Generic Permission Source # | |||||
Defined in Language.Github.Actions.Permissions Associated Types
| |||||
| Show Permission Source # | |||||
Defined in Language.Github.Actions.Permissions Methods showsPrec :: Int -> Permission -> ShowS # show :: Permission -> String # showList :: [Permission] -> ShowS # | |||||
| Eq Permission Source # | |||||
Defined in Language.Github.Actions.Permissions | |||||
| Ord Permission Source # | |||||
Defined in Language.Github.Actions.Permissions Methods compare :: Permission -> Permission -> Ordering # (<) :: Permission -> Permission -> Bool # (<=) :: Permission -> Permission -> Bool # (>) :: Permission -> Permission -> Bool # (>=) :: Permission -> Permission -> Bool # max :: Permission -> Permission -> Permission # min :: Permission -> Permission -> Permission # | |||||
| type Rep Permission Source # | |||||
Defined in Language.Github.Actions.Permissions type Rep Permission = D1 ('MetaData "Permission" "Language.Github.Actions.Permissions" "github-actions-0.1.1.0-BjHhRMO6iQ17qdsNXwhDab" 'False) (C1 ('MetaCons "None" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Read" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Write" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
gen :: MonadGen m => m Permissions Source #