@@ -15,10 +15,12 @@ class GitHubActionsVersionUpdater:
1515 github_url = 'https://github.com/'
1616 action_label = 'uses'
1717
18- def __init__ (self , repository , base_branch , token , ignore_actions = None ):
18+ def __init__ (self , repository , base_branch , token , commit_message = None , pr_title = None , ignore_actions = None ):
1919 self .repository = repository
2020 self .base_branch = base_branch
2121 self .token = token
22+ self .commit_message = commit_message or 'Update GitHub Action Versions'
23+ self .pr_title = pr_title or 'Update GitHub Action Versions'
2224 self .ignore_actions = self .get_ignored_actions (ignore_actions )
2325 self .workflow_updated = False
2426
@@ -183,7 +185,7 @@ def create_new_branch(self):
183185 )
184186 subprocess .run (['git' , 'add' , '.' ])
185187 subprocess .run (
186- ['git' , 'commit' , '-m' , 'Update GitHub Action Versions' ]
188+ ['git' , 'commit' , '-m' , self . commit_message ]
187189 )
188190
189191 subprocess .run (['git' , 'push' , '-u' , 'origin' , new_branch ])
@@ -196,7 +198,7 @@ def create_pull_request(self, branch_name, body):
196198 """Create pull request on GitHub"""
197199 url = f'{ self .github_api_url } /repos/{ self .repository } /pulls'
198200 payload = {
199- 'title' : 'Update GitHub Action Versions' ,
201+ 'title' : self . pr_title ,
200202 'head' : branch_name ,
201203 'base' : self .base_branch ,
202204 'body' : body ,
@@ -312,6 +314,10 @@ def print_message(message, message_type=None):
312314 email = os .environ ['INPUT_COMMITTER_EMAIL' ]
313315 # Actions that should not be updated
314316 ignore = os .environ ['INPUT_IGNORE' ]
317+ # Commit message
318+ commit_message = os .environ ['INPUT_COMMIT_MESSAGE' ]
319+ # Pull Request Title
320+ pr_title = os .environ ['INPUT_PULL_REQUEST_TITLE' ]
315321
316322 # Group: Configure Git
317323 print_message ('Configure Git' , message_type = 'group' )
@@ -326,7 +332,7 @@ def print_message(message, message_type=None):
326332
327333 # Initialize GitHubActionsVersionUpdater
328334 actions_version_updater = GitHubActionsVersionUpdater (
329- repository , base_branch , token , ignore_actions = ignore
335+ repository , base_branch , token , commit_message = commit_message , pr_title = pr_title , ignore_actions = ignore
330336 )
331337 actions_version_updater .run ()
332338
0 commit comments