Skip to content

Commit

Permalink
Remove permissions from step in usage, incorrect syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx committed Apr 25, 2024
1 parent b553cf7 commit b35c134
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/gh-actions-docs/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,12 @@ prettyPrintPermissions _ = ""


prettyPrintUsage :: String -> Maybe Inputs -> ActionMetadata -> String
prettyPrintUsage name' inputs' (ActionMetadata path' (Just owner') (Just project') (Just version') permissions') =
prettyPrintUsage name' inputs' (ActionMetadata path' (Just owner') (Just project') (Just version') _) =
"### Usage\n"++
"```yaml\n"
++ "- name: " ++ name' ++ "\n"
++ " uses: "
++ owner' ++ "/" ++ project' ++ actionPathWithoutFile ++ "@" ++ version' ++ "\n"
++ prettyPrintUsagePermissions permissions'
++ prettyPrintUsageWith inputs'
++ "```\n"
where
Expand All @@ -196,18 +195,8 @@ prettyPrintUsage name' inputs' (ActionMetadata path' (Just owner') (Just project
prependSlashIfNotEmpty x = "/" ++ x
prettyPrintUsage _ _ _ = ""

prettyPrintUsagePermissions :: Maybe Permissions -> String
prettyPrintUsagePermissions (Just permissions'') =
" permissions:\n"
++ concatMap
( \(name', access) ->
" " ++ name' ++ ": " ++ show access ++ "\n"
)
(toList permissions'')
prettyPrintUsagePermissions Nothing = ""

prettyPrintUsageWith :: Maybe Inputs -> String
prettyPrintUsageWith (Just inputs'') = " with:\n" ++ concatMap (uncurry prettyPrintUsageInputs) (toList inputs'')
prettyPrintUsageWith (Just inputs') = " with:\n" ++ concatMap (uncurry prettyPrintUsageInputs) (toList inputs')
prettyPrintUsageWith Nothing = ""

prettyPrintUsageInputs :: String -> ActionInput -> String
Expand Down

0 comments on commit b35c134

Please sign in to comment.