diff --git a/.markdownlint.yml b/.markdownlint.yml index 144bda4..2a0adfc 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -4,3 +4,4 @@ MD013: line_length: 255 MD024: siblings_only: true +MD026: false diff --git a/CHANGELOG.md b/CHANGELOG.md index c3be010..ef6f07e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Make `known-hosts` required +## [1.6.4] - 2020-01-27 + +### Fixed + +* `node_modules/.bin` error (thanks [@george3447](https://github.com/george3447)) + +## [1.6.3] - 2020-01-27 + +### Others + +* add Q&A + +## [1.6.2] - 2020-01-25 + +### Others + +* some updates + ## [1.6.1] - 2020-01-19 ### Fixed @@ -63,7 +81,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * First release. -[Unreleased]: https://github.com/shimataro/ssh-key-action/compare/v1.6.1...HEAD +[Unreleased]: https://github.com/shimataro/ssh-key-action/compare/v1.6.4...HEAD +[1.6.4]: https://github.com/shimataro/ssh-key-action/compare/v1.6.3...v1.6.4 +[1.6.3]: https://github.com/shimataro/ssh-key-action/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/shimataro/ssh-key-action/compare/v1.6.1...v1.6.2 [1.6.1]: https://github.com/shimataro/ssh-key-action/compare/v1.6.0...v1.6.1 [1.6.0]: https://github.com/shimataro/ssh-key-action/compare/v1.5.0...v1.6.0 [1.5.0]: https://github.com/shimataro/ssh-key-action/compare/v1.4.0...v1.5.0 diff --git a/README.md b/README.md index 1926994..0f9066a 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ Useful for SCP, SFTP, and `rsync` over SSH in deployment script. Add your SSH key to your product secrets by clicking `Settings` - `Secrets` - `Add a new secret` beforehand. +**NOTE:** OPENSSH format (key begins with `-----BEGIN OPENSSH PRIVATE KEY-----`) may not work due to OpenSSH version on VM. Please use PEM format (begins with `-----BEGIN RSA PRIVATE KEY-----`) instead. + ```yaml runs-on: ubuntu-latest steps: @@ -29,8 +31,6 @@ steps: name: id_rsa # optional known-hosts: ${{ secrets.KNOWN_HOSTS }} # known_hosts config: ${{ secrets.CONFIG }} # ssh_config; optional -- name: Install packages - run: apt install openssh-client rsync - name: rsync over ssh run: rsync ./foo/ user@remote:bar/ ``` @@ -42,7 +42,7 @@ See [Workflow syntax for GitHub Actions](https://help.github.com/en/articles/wor If you want to install multiple keys, call this action multiple times. It is useful for port forwarding. -**NOTE:** When this action is called multiple times, **the contents of `known-hosts` and `config` will be appended**. But `private-key` must be saved as different name, by using `name` option. +**NOTE:** When this action is called multiple times, **the contents of `known-hosts` and `config` will be appended**. `private-key` must be saved as different name, by using `name` option. ```yaml runs-on: ubuntu-latest @@ -70,12 +70,53 @@ steps: User user-of-target IdentityFile ~/.ssh/id_rsa-target ProxyCommand ssh -W %h:%p bastion -- name: Install packages - run: apt install openssh-client - name: SCP via port-forwarding run: scp ./foo/ target:bar/ ``` +## Q&A + +### SSH failed even though key has been installed. + +Check belows: + +* `Load key "/HOME/.ssh/id_rsa": invalid format`: + * OPENSSH format (key begins with `-----BEGIN OPENSSH PRIVATE KEY-----`) may not work. + * Use PEM format (begins with `-----BEGIN RSA PRIVATE KEY-----`). +* `Host key verification failed.`: + * Set `known-hosts` option or use `ssh -o StrictHostKeyChecking=no`. + * The former is **HIGHLY** recommended for security reason. + * I'm planning to make `known-hosts` required in v2. + +### How do I use encrypted SSH key? + +This action doesn't support encrypted key directly. +Here are some solutions: + +* decrypting key beforehand: best bet, and works on any VM +* `sshpass` command: next best bet, but not supported on Windows +* `expect` command: be careful not to expose passphrase to console +* `SSH_ASKPASS` environment variable: might be troublesome + +### Which one is the best way for transferring files, "direct SCP/SFTP/rsync" or "SCP/SFTP/rsync via bastion"? + +I recommend **rsync via bastion**. +It has some advantages over other methods: + +* "Rsync via bastion" doesn't require to update workflow files and `secrets` even if it is necessary to transfer files to multiple servers. + * Other methods require to update `known-hosts` if servers have changed. +* Rsync: + * is fastest of all. + * does **NOT** break files even if disconnected during transferring. + * can remove files that don't exist on server. +* SCP is [deprecated by OpenSSH](https://www.openssh.com/txt/release-8.0) due to outdated and inflexible protocol. +* Using bastion is more secure because: + * it is not necessarily to expose SSH port on servers to public. + * Address filtering is less effective. + * Because Azure address range is [very wide](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#ip-addresses-of-github-hosted-runners). + * And will be updated continuously. + * if security incident ―e.g., private key leaked― occurs, it's OK just to remove `authorized_keys` on bastion. + ## License The scripts and documentation in this project are released under the [MIT License](LICENSE) @@ -84,15 +125,15 @@ The scripts and documentation in this project are released under the [MIT Licens See [CHANGELOG.md](CHANGELOG.md). -[image-build]: https://github.com/shimataro/ssh-key-action/workflows/Build/badge.svg +[image-build]: https://github.com/shimataro/ssh-key-action/workflows/Build/badge.svg?event=push&branch=v1 [link-build]: https://github.com/shimataro/ssh-key-action -[image-verify-windows]: https://github.com/shimataro/ssh-key-action/workflows/Windows/badge.svg -[image-verify-macos]: https://github.com/shimataro/ssh-key-action/workflows/macOS/badge.svg -[image-verify-ubuntu]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu/badge.svg -[image-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu%2016.04/badge.svg +[image-verify-windows]: https://github.com/shimataro/ssh-key-action/workflows/Windows/badge.svg?event=push&branch=v1 [link-verify-windows]: https://github.com/shimataro/ssh-key-action +[image-verify-macos]: https://github.com/shimataro/ssh-key-action/workflows/macOS/badge.svg?event=push&branch=v1 [link-verify-macos]: https://github.com/shimataro/ssh-key-action +[image-verify-ubuntu]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu/badge.svg?event=push&branch=v1 [link-verify-ubuntu]: https://github.com/shimataro/ssh-key-action +[image-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu%2016.04/badge.svg?event=push&branch=v1 [link-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action [image-release]: https://img.shields.io/github/release/shimataro/ssh-key-action.svg [link-release]: https://github.com/shimataro/ssh-key-action/releases diff --git a/node_modules/@actions/core/lib/command.d.ts b/node_modules/@actions/core/lib/command.d.ts index 7f6fecb..51b8f11 100644 --- a/node_modules/@actions/core/lib/command.d.ts +++ b/node_modules/@actions/core/lib/command.d.ts @@ -5,11 +5,11 @@ interface CommandProperties { * Commands * * Command Format: - * ##[name key=value;key=value]message + * ::name key=value,key=value::message * * Examples: - * ##[warning]This is the user warning message - * ##[set-secret name=mypassword]definitelyNotAPassword! + * ::warning::This is the message + * ::set-env name=MY_VAR::some value */ export declare function issueCommand(command: string, properties: CommandProperties, message: string): void; export declare function issue(name: string, message?: string): void; diff --git a/node_modules/@actions/core/lib/command.js b/node_modules/@actions/core/lib/command.js index aaed8b7..eeef233 100644 --- a/node_modules/@actions/core/lib/command.js +++ b/node_modules/@actions/core/lib/command.js @@ -1,15 +1,22 @@ "use strict"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; Object.defineProperty(exports, "__esModule", { value: true }); -const os = require("os"); +const os = __importStar(require("os")); /** * Commands * * Command Format: - * ##[name key=value;key=value]message + * ::name key=value,key=value::message * * Examples: - * ##[warning]This is the user warning message - * ##[set-secret name=mypassword]definitelyNotAPassword! + * ::warning::This is the message + * ::set-env name=MY_VAR::some value */ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); @@ -45,29 +52,27 @@ class Command { else { cmdStr += ','; } - // safely append the val - avoid blowing up when attempting to - // call .replace() if message is not a string for some reason - cmdStr += `${key}=${escape(`${val || ''}`)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } } - cmdStr += CMD_STRING; - // safely append the message - avoid blowing up when attempting to - // call .replace() if message is not a string for some reason - const message = `${this.message || ''}`; - cmdStr += escapeData(message); + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } } function escapeData(s) { - return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A'); + return (s || '') + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); } -function escape(s) { - return s +function escapeProperty(s) { + return (s || '') + .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') - .replace(/]/g, '%5D') - .replace(/;/g, '%3B'); + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); } //# sourceMappingURL=command.js.map \ No newline at end of file diff --git a/node_modules/@actions/core/lib/command.js.map b/node_modules/@actions/core/lib/command.js.map index 7904e22..00a9861 100644 --- a/node_modules/@actions/core/lib/command.js.map +++ b/node_modules/@actions/core/lib/command.js.map @@ -1 +1 @@ -{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;AAAA,yBAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG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IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@actions/core/lib/core.js b/node_modules/@actions/core/lib/core.js index f43d507..b99e1de 100644 --- a/node_modules/@actions/core/lib/core.js +++ b/node_modules/@actions/core/lib/core.js @@ -8,10 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = require("./command"); -const os = require("os"); -const path = require("path"); +const os = __importStar(require("os")); +const path = __importStar(require("path")); /** * The code to exit an action */ diff --git a/node_modules/@actions/core/lib/core.js.map b/node_modules/@actions/core/lib/core.js.map index 6eda8da..33c6268 100644 --- a/node_modules/@actions/core/lib/core.js.map +++ b/node_modules/@actions/core/lib/core.js.map @@ -1 +1 @@ -{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAA6C;AAE7C,yBAAwB;AACxB,6BAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CA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;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"} \ No newline at end of file diff --git a/node_modules/@actions/core/package.json b/node_modules/@actions/core/package.json index 217ac41..d0b416d 100644 --- a/node_modules/@actions/core/package.json +++ b/node_modules/@actions/core/package.json @@ -1,6 +1,6 @@ { "name": "@actions/core", - "version": "1.2.1", + "version": "1.2.2", "description": "Actions core lib", "keywords": [ "github", @@ -38,7 +38,7 @@ "@types/node": "^12.0.2" } -,"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.1.tgz" -,"_integrity": "sha512-xD+CQd9p4lU7ZfRqmUcbJpqR+Ss51rJRVeXMyOLrZQImN9/8Sy/BEUBnHO/UKD3z03R686PVTLfEPmkropGuLw==" -,"_from": "@actions/core@1.2.1" +,"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.2.tgz" +,"_integrity": "sha512-IbCx7oefq+Gi6FWbSs2Fnw8VkEI6Y4gvjrYprY3RV//ksq/KPMlClOerJ4jRosyal6zkUIc8R9fS/cpRMlGClg==" +,"_from": "@actions/core@1.2.2" } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0eb6ad6..5a06dc2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "install-ssh-key", - "version": "1.6.1", + "version": "1.6.4", "lockfileVersion": 1, "requires": true, "dependencies": { "@actions/core": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.1.tgz", - "integrity": "sha512-xD+CQd9p4lU7ZfRqmUcbJpqR+Ss51rJRVeXMyOLrZQImN9/8Sy/BEUBnHO/UKD3z03R686PVTLfEPmkropGuLw==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.2.tgz", + "integrity": "sha512-IbCx7oefq+Gi6FWbSs2Fnw8VkEI6Y4gvjrYprY3RV//ksq/KPMlClOerJ4jRosyal6zkUIc8R9fS/cpRMlGClg==" }, "@babel/code-frame": { "version": "7.8.3", @@ -81,18 +81,18 @@ "dev": true }, "@types/node": { - "version": "13.1.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.8.tgz", - "integrity": "sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A==", + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.5.0.tgz", + "integrity": "sha512-Onhn+z72D2O2Pb2ql2xukJ55rglumsVo1H6Fmyi8mlU9SvKdBk/pUSUAiBY/d9bAOF7VVWajX3sths/+g6ZiAQ==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.16.0.tgz", - "integrity": "sha512-TKWbeFAKRPrvKiR9GNxErQ8sELKqg1ZvXi6uho07mcKShBnCnqNpDQWP01FEvWKf0bxM2g7uQEI5MNjSNqvUpQ==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.17.0.tgz", + "integrity": "sha512-tg/OMOtPeXlvk0ES8mZzEZ4gd1ruSE03nsKcK+teJhxYv5CPCXK6Mb/OK6NpB4+CqGTHs4MVeoSZXNFqpT1PyQ==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.16.0", + "@typescript-eslint/experimental-utils": "2.17.0", "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -100,32 +100,32 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.16.0.tgz", - "integrity": "sha512-bXTmAztXpqxliDKZgvWkl+5dHeRN+jqXVZ16peKKFzSXVzT6mz8kgBpHiVzEKO2NZ8OCU7dG61K9sRS/SkUUFQ==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.17.0.tgz", + "integrity": "sha512-2bNf+mZ/3mj5/3CP56v+ldRK3vFy9jOvmCPs/Gr2DeSJh+asPZrhFniv4QmQsHWQFPJFWhFHgkGgJeRmK4m8iQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.16.0", + "@typescript-eslint/typescript-estree": "2.17.0", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/parser": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.16.0.tgz", - "integrity": "sha512-+w8dMaYETM9v6il1yYYkApMSiwgnqXWJbXrA94LAWN603vXHACsZTirJduyeBOJjA9wT6xuXe5zZ1iCUzoxCfw==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.17.0.tgz", + "integrity": "sha512-k1g3gRQ4fwfJoIfgUpz78AovicSWKFANmvTfkAHP24MgJHjWfZI6ya7tsQZt1sLczvP4G9BE5G5MgADHdmJB/w==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.16.0", - "@typescript-eslint/typescript-estree": "2.16.0", + "@typescript-eslint/experimental-utils": "2.17.0", + "@typescript-eslint/typescript-estree": "2.17.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.16.0.tgz", - "integrity": "sha512-hyrCYjFHISos68Bk5KjUAXw0pP/455qq9nxqB1KkT67Pxjcfw+r6Yhcmqnp8etFL45UexCHUMrADHH7dI/m2WQ==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.17.0.tgz", + "integrity": "sha512-g0eVRULGnEEUakxRfJO0s0Hr1LLQqsI6OrkiCLpdHtdJJek+wyd8mb00vedqAoWldeDcOcP8plqw8/jx9Gr3Lw==", "dev": true, "requires": { "debug": "^4.1.1", @@ -831,9 +831,9 @@ } }, "es-abstract": { - "version": "1.17.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.2.tgz", - "integrity": "sha512-YoKuru3Lyoy7yVTBSH2j7UxTqe/je3dWAruC0sHvZX1GNd5zX8SSLvQqEgO9b3Ex8IW+goFI9arEEsFIbulhOw==", + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", + "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -1237,9 +1237,9 @@ "dev": true }, "fs-minipass": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.0.0.tgz", - "integrity": "sha512-40Qz+LFXmd9tzYVnnBmZvFfvAADfUA14TXPK1s7IfElJTIZ97rA8w4Kin7Wt5JBrC3ShnnFJO/5vPjPEeJIq9A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, "requires": { "minipass": "^3.0.0" @@ -1542,9 +1542,9 @@ "dev": true }, "inquirer": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.3.tgz", - "integrity": "sha512-+OiOVeVydu4hnCGLCSX+wedovR/Yzskv9BFqUNNKq9uU2qg7LCcCo3R86S2E7WLo0y/x2pnEZfZe1CoYnORUAw==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.4.tgz", + "integrity": "sha512-Bu5Td5+j11sCkqfqmUTiwv+tWisMtP0L7Q8WrqA2C/BbBhy1YTdFrvjjlrKq8oagA/tLQBski2Gcx/Sqyi2qSQ==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", @@ -3194,13 +3194,12 @@ "dev": true }, "registry-auth-token": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.0.tgz", - "integrity": "sha512-7uxS951DeOBOwsv8deX+l7HcjY2VZxaOgHtM6RKzg3HhpE+bJ0O7VbuMJLosC1T5WSFpHm0DuFIbqUl43jHpsA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz", + "integrity": "sha512-9bKS7nTl9+/A1s7tnPeGrUpRcVY+LUh7bfFgzpndALdPfXQBfQV77rQVtqgUV3ti4vc/Ik81Ex8UJDWDQ12zQA==", "dev": true, "requires": { - "rc": "^1.2.8", - "safe-buffer": "^5.0.1" + "rc": "^1.2.8" } }, "registry-url": { @@ -3241,9 +3240,9 @@ } }, "resolve": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.2.tgz", - "integrity": "sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz", + "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==", "dev": true, "requires": { "path-parse": "^1.0.6" diff --git a/package.json b/package.json index ab008c0..4c46693 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "install-ssh-key", - "version": "1.6.1", + "version": "1.6.4", "private": true, "description": "Install SSH key in .ssh", "main": "lib/main.js", @@ -31,12 +31,12 @@ "author": "shimataro", "license": "MIT", "dependencies": { - "@actions/core": "1.2.1" + "@actions/core": "1.2.2" }, "devDependencies": { - "@types/node": "13.1.8", - "@typescript-eslint/eslint-plugin": "2.16.0", - "@typescript-eslint/parser": "2.16.0", + "@types/node": "13.5.0", + "@typescript-eslint/eslint-plugin": "2.17.0", + "@typescript-eslint/parser": "2.17.0", "eslint": "6.8.0", "eslint-plugin-import": "2.20.0", "markdownlint-cli": "0.21.0", diff --git a/scripts/create-release-branch.sh b/scripts/create-release-branch.sh index 210c5fc..65b0f72 100755 --- a/scripts/create-release-branch.sh +++ b/scripts/create-release-branch.sh @@ -3,6 +3,8 @@ # - git; I believe it's already installed. # - sed; GNU sed is preferred. POSIX sed may not work. +set -e + BASE_BRANCH="develop" PACKAGE_NAME="ssh-key-action" @@ -36,14 +38,14 @@ function main() { check_version_format ${VERSION} check_current_branch - run create_branch ${BRANCH} - run update_changelog ${VERSION} - run update_package_version ${VERSION} - run update_dependencies_version - run regenerate_package_lock - run build_package - run commit_changes ${VERSION} - run finish ${VERSION} ${BRANCH} ${TAG} + create_branch ${BRANCH} + update_changelog ${VERSION} + update_package_version ${VERSION} + update_dependencies_version + regenerate_package_lock + build_package + commit_changes ${VERSION} + finish ${VERSION} ${BRANCH} ${TAG} } function usage() { @@ -91,10 +93,6 @@ function check_current_branch() { exit 2 } -function run() { - "$@" || exit 1 -} - function create_branch() { local BRANCH=$1 @@ -121,12 +119,13 @@ function update_package_version() { } function update_dependencies_version() { + npm ci npm run check-updates -- -u } function regenerate_package_lock() { - rm -rf package-lock.json node_modules && - npm install + rm -rf package-lock.json node_modules + npm install } function build_package() { @@ -137,9 +136,10 @@ function build_package() { function commit_changes() { local VERSION=$1 - npm ci --only=production && - git add CHANGELOG.md package.json package-lock.json node_modules lib && - git commit -m "version ${VERSION}" + rm -rf node_modules + npm ci --only=production + git add CHANGELOG.md package.json package-lock.json node_modules lib + git commit -m "version ${VERSION}" } function finish() { diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh index fbc39c2..b2c853a 100755 --- a/scripts/rebuild.sh +++ b/scripts/rebuild.sh @@ -1,9 +1,12 @@ #!/bin/bash +set -e + rm -rf node_modules package-lock.json npm i npm run build npm run verify +rm -rf node_modules npm ci --only=production git add node_modules package-lock.json lib diff --git a/scripts/update-dependencies.sh b/scripts/update-dependencies.sh index b859641..1463fdb 100755 --- a/scripts/update-dependencies.sh +++ b/scripts/update-dependencies.sh @@ -1,30 +1,34 @@ #!/bin/bash # update dependencies +set -e + DATE=$(date +"%Y%m%d") BRANCH=feature/update-dependencies-${DATE} COLOR_SUCCESS="\e[1;32m" COLOR_RESET="\e[m" # create branch -git checkout develop || exit 1 -git checkout -b ${BRANCH} || exit 1 +git checkout develop +git checkout -b ${BRANCH} # check updates npm ci -npm run check-updates -- -u || exit 1 +npm run check-updates -- -u # re-install packages -rm -rf package-lock.json node_modules || exit 1 -npm i || exit 1 +rm -rf package-lock.json node_modules +npm i -# build check -npm run build || exit 1 +# check +npm run build +npm run verify # commit -npm ci --only=production || exit 1 -git add package.json package-lock.json node_modules || exit 1 -git commit -m "update dependencies" || exit 1 +rm -rf node_modules +npm ci --only=production +git add package.json package-lock.json node_modules +git commit -m "update dependencies" # finished! echo -e "