File tree Expand file tree Collapse file tree 4 files changed +18
-10
lines changed
Expand file tree Collapse file tree 4 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 1515 LINGODOTDEV_COMMIT_MESSAGE : ${{ inputs.commit-message }}
1616 LINGODOTDEV_PULL_REQUEST_TITLE : ${{ inputs.pull-request-title }}
1717 LINGODOTDEV_WORKING_DIRECTORY : ${{ inputs.working-directory }}
18-
18+ LINGODOTDEV_PROCESS_OWN_COMMITS : ${{ inputs.process-own-commits }}
1919inputs :
2020 api-key :
2121 description : " Lingo.dev Platform API Key"
@@ -33,3 +33,6 @@ inputs:
3333 working-directory :
3434 description : " Working directory"
3535 required : false
36+ process-own-commits :
37+ description : " Process commits made by this action"
38+ required : false
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export class InBranchFlow extends IntegrationFlow {
5555 }
5656
5757 private configureGit ( ) {
58+ const { processOwnCommits } = this . platformKit . config ;
5859 const { baseBranchName } = this . platformKit . platformConfig ;
5960
6061 this . ora . info ( `Current working directory:` ) ;
@@ -72,14 +73,16 @@ export class InBranchFlow extends IntegrationFlow {
7273 execSync ( `git fetch origin ${ baseBranchName } ` , { stdio : "inherit" } ) ;
7374 execSync ( `git checkout ${ baseBranchName } --` , { stdio : "inherit" } ) ;
7475
75- const currentAuthor = `${ gitConfig . userName } <${ gitConfig . userEmail } >` ;
76- const authorOfLastCommit = execSync ( `git log -1 --pretty=format:'%an <%ae>'` ) . toString ( ) ;
77- if ( authorOfLastCommit === currentAuthor ) {
78- this . ora . warn ( `The action will not run on commits by ${ currentAuthor } ` ) ;
79- this . ora . warn (
80- `The last commit was already made by this action. Running this action again will not change anything.` ,
81- ) ;
82- return false ;
76+ if ( ! processOwnCommits ) {
77+ const currentAuthor = `${ gitConfig . userName } <${ gitConfig . userEmail } >` ;
78+ const authorOfLastCommit = execSync ( `git log -1 --pretty=format:'%an <%ae>'` ) . toString ( ) ;
79+ if ( authorOfLastCommit === currentAuthor ) {
80+ this . ora . warn ( `The action will not run on commits by ${ currentAuthor } ` ) ;
81+ this . ora . warn (
82+ `The last commit was already made by this action. Running this action again will not change anything.` ,
83+ ) ;
84+ return false ;
85+ }
8386 }
8487
8588 const workingDir = path . resolve ( process . cwd ( ) , this . platformKit . config . workingDir ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export abstract class PlatformKit<PlatformConfig extends BasePlatformConfig = Ba
3232 LINGODOTDEV_COMMIT_MESSAGE : Z . string ( ) . optional ( ) ,
3333 LINGODOTDEV_PULL_REQUEST_TITLE : Z . string ( ) . optional ( ) ,
3434 LINGODOTDEV_WORKING_DIRECTORY : Z . string ( ) . optional ( ) ,
35+ LINGODOTDEV_PROCESS_OWN_COMMITS : Z . preprocess ( ( val ) => val === "true" || val === true , Z . boolean ( ) ) . optional ( ) ,
3536 } ) . parse ( process . env ) ;
3637
3738 return {
@@ -40,6 +41,7 @@ export abstract class PlatformKit<PlatformConfig extends BasePlatformConfig = Ba
4041 commitMessage : env . LINGODOTDEV_COMMIT_MESSAGE || defaultMessage ,
4142 pullRequestTitle : env . LINGODOTDEV_PULL_REQUEST_TITLE || defaultMessage ,
4243 workingDir : env . LINGODOTDEV_WORKING_DIRECTORY || "." ,
44+ processOwnCommits : env . LINGODOTDEV_PROCESS_OWN_COMMITS || false ,
4345 } ;
4446 }
4547}
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export default new Command()
6060 validateParams ( i18nConfig , flags ) ;
6161 ora . succeed ( "Localization configuration is valid" ) ;
6262
63- ora . start ( "Connecting to Replexica Localization Engine..." ) ;
63+ ora . start ( "Connecting to Lingo.dev Localization Engine..." ) ;
6464 const auth = await validateAuth ( settings ) ;
6565 ora . succeed ( `Authenticated as ${ auth . email } ` ) ;
6666
You can’t perform that action at this time.
0 commit comments