diff --git a/README.md b/README.md index d41a2a3..ef8a0b1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ steps: | `github_token` | GitHub's Personal Access Token (PAT). | `GITHUB_TOKEN` | | `patcher_command` | Patcher command to run. Valid options: `update` or `report`. | `update` | | `working_dir` | Directory where Patcher should run. If empty, it will run in the whole repo. | | -| `update_strategy` | Update strategy. Only used when running `update`. Valid options: `next-safe` or `next-breaking`. | `next-safe` | +| `update_strategy` | Update strategy. Only used when running `update`. Valid options: `next-safe` or `next-breaking`. Refer to the ["Update Strategies" documentation](https://docs.gruntwork.io/patcher/update-strategies). | `next-breaking` | | `dependency` | Target the update to a single dependency. Only used when running `update`. Format: `//`. Example: `gruntwork-io/terraform-aws-service-catalog/services/ecs-module`. | | | `commit_author` | Author of the Pull Request's commits in the format `Name `. Only used when running `update`. The permissions to push the changes and to create the Pull Request are from 'github_token'. | `gruntwork-patcher-bot ` | diff --git a/action.yml b/action.yml index 47427ac..bc5ab78 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,8 @@ inputs: description: "Patcher command to run. Valid options: 'update' or 'report'." default: "update" update_strategy: - description: "Update strategy. Only used when running 'update'. Defaults to 'next-safe'." + description: "Update strategy. Only used when running 'update'. Defaults to 'next-breaking'." + default: "next-breaking" dependency: description: > "Target the update to a single dependency. Format: //." diff --git a/dist/index.js b/dist/index.js index a551497..78cf4a4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13542,6 +13542,8 @@ const VALID_COMMANDS = [REPORT_COMMAND, UPDATE_COMMAND]; const NON_INTERACTIVE_FLAG = "--non-interactive"; const NO_COLOR_FLAG = "--no-color"; const SKIP_CONTAINER_FLAG = "--skip-container-runtime"; +const UPDATE_STRATEGY_FLAG = "--update-strategy"; +const TARGET_FLAG = "--target"; function osPlatform() { const platform = os.platform(); switch (platform) { @@ -13649,14 +13651,14 @@ function isPatcherCommandValid(command) { } function updateArgs(updateStrategy, dependency, workingDir) { let args = ["update", NO_COLOR_FLAG, NON_INTERACTIVE_FLAG, SKIP_CONTAINER_FLAG]; - // If updateStrategy or dependency are not empty, are not empty, assign them with the appropriate flag. + // If updateStrategy or dependency are not empty, assign them with the appropriate flag. // If they are invalid, Patcher will return an error, which will cause the Action to fail. if (updateStrategy !== "") { - args = args.concat(`--update-strategy=${updateStrategy}`); + args = args.concat(`${UPDATE_STRATEGY_FLAG}=${updateStrategy}`); } // If a dependency is provided, set the `target` flag so Patcher can limit the update to a single dependency. if (dependency !== "") { - args = args.concat(`--target=${dependency}`); + args = args.concat(`${TARGET_FLAG}=${dependency}`); } return args.concat([workingDir]); } diff --git a/src/action.ts b/src/action.ts index 4b9497d..cef6034 100644 --- a/src/action.ts +++ b/src/action.ts @@ -20,6 +20,8 @@ const VALID_COMMANDS = [REPORT_COMMAND, UPDATE_COMMAND]; const NON_INTERACTIVE_FLAG = "--non-interactive" const NO_COLOR_FLAG = "--no-color" const SKIP_CONTAINER_FLAG = "--skip-container-runtime" +const UPDATE_STRATEGY_FLAG = "--update-strategy" +const TARGET_FLAG = "--target" // Define types @@ -172,15 +174,15 @@ function isPatcherCommandValid(command: string): boolean { function updateArgs(updateStrategy: string, dependency: string, workingDir: string): string[] { let args = ["update", NO_COLOR_FLAG, NON_INTERACTIVE_FLAG, SKIP_CONTAINER_FLAG]; - // If updateStrategy or dependency are not empty, are not empty, assign them with the appropriate flag. + // If updateStrategy or dependency are not empty, assign them with the appropriate flag. // If they are invalid, Patcher will return an error, which will cause the Action to fail. if (updateStrategy !== "") { - args = args.concat(`--update-strategy=${updateStrategy}`) + args = args.concat(`${UPDATE_STRATEGY_FLAG}=${updateStrategy}`) } // If a dependency is provided, set the `target` flag so Patcher can limit the update to a single dependency. if (dependency !== "") { - args = args.concat(`--target=${dependency}`) + args = args.concat(`${TARGET_FLAG}=${dependency}`) } return args.concat([workingDir]);