From ba6e3651b706e015cd659c22052204f664591b64 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 1 May 2020 19:10:35 +0900 Subject: [PATCH 1/3] Add ci workflow --- .github/workflows/ci.yml | 95 ++++++++++++++++++++ .github/workflows/create-on-pull-request.yml | 34 ------- 2 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/create-on-pull-request.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f64064c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,95 @@ +name: CI +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + build: + runs-on: ubuntu-latest + outputs: + issue-number: ${{ steps.vars.outputs.issue-number }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - run: npm ci + - run: npm run test + - run: npm run package + - uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + - id: vars + run: | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then \ + echo "::set-output name=issue-number::${{ github.event.number }}" \ + else \ + echo "::set-output name=issue-number::1"; fi + + test: + needs: [build] + runs-on: ubuntu-latest + strategy: + matrix: + target: [built, committed] + steps: + - uses: actions/checkout@v2 + - if: matrix.target == 'built' + uses: actions/download-artifact@v2 + with: + name: dist + path: dist + + - name: Test create comment + uses: ./ + id: couc + with: + issue-number: ${{ needs.build.outputs.issue-number }} + body: | + This is a multi-line test comment + - With GitHub **Markdown** + - Created by [create-or-update-comment][1] + + [1]: https://github.com/peter-evans/create-or-update-comment + reactions: '+1' + + - name: Test update comment + uses: ./ + with: + comment-id: ${{ steps.couc.outputs.comment-id }} + body: | + **Edit:** Some additional info + reactions: eyes + + - name: Test add reactions + uses: ./ + with: + comment-id: ${{ steps.couc.outputs.comment-id }} + reactions: heart, hooray, laugh + + package: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: dist + path: dist + - name: Create Pull Request + uses: peter-evans/create-pull-request@v2 + with: + commit-message: Update distribution + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + title: Update distribution + body: | + - Updates the distribution for changes on `master` + + Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request + branch: update-distribution diff --git a/.github/workflows/create-on-pull-request.yml b/.github/workflows/create-on-pull-request.yml deleted file mode 100644 index 47f9db7..0000000 --- a/.github/workflows/create-on-pull-request.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Create Comment on Pull Request -on: - pull_request: - branches: - - master -jobs: - createCommentOnPullRequest: - if: github.event.pull_request.author_association == 'OWNER' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # For debugging purposes. Remove this in production. - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - - name: Create comment - uses: ./ - id: couc - with: - issue-number: ${{ github.event.number }} - body: | - This is a multi-line test comment - - With GitHub **Markdown** - - Created by [create-or-update-comment][1] - - [1]: https://github.com/peter-evans/create-or-update-comment - reaction-type: '+1' - - - name: Check outputs - run: | - echo "Comment ID - ${{ steps.couc.outputs.comment-id }}" From 242194048b904ac7ee9b66ef109fe5be99012ca3 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 1 May 2020 19:25:36 +0900 Subject: [PATCH 2/3] Pin dependencies --- package-lock.json | 119 ++++++++++++++++++++++++++++++++++------------ package.json | 4 +- 2 files changed, 90 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 99e4075..a75a3ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -929,13 +929,23 @@ } }, "@octokit/endpoint": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.1.tgz", - "integrity": "sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz", + "integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==", "requires": { - "@octokit/types": "^2.0.0", + "@octokit/types": "^2.11.1", "is-plain-object": "^3.0.0", - "universal-user-agent": "^4.0.0" + "universal-user-agent": "^5.0.0" + }, + "dependencies": { + "universal-user-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", + "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", + "requires": { + "os-name": "^3.1.0" + } + } } }, "@octokit/graphql": { @@ -948,25 +958,57 @@ "universal-user-agent": "^4.0.0" } }, - "@octokit/request": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.1.tgz", - "integrity": "sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg==", + "@octokit/plugin-paginate-rest": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", + "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==", "requires": { - "@octokit/endpoint": "^5.5.0", - "@octokit/request-error": "^1.0.1", - "@octokit/types": "^2.0.0", + "@octokit/types": "^2.0.1" + } + }, + "@octokit/plugin-request-log": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz", + "integrity": "sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw==" + }, + "@octokit/plugin-rest-endpoint-methods": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz", + "integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==", + "requires": { + "@octokit/types": "^2.0.1", + "deprecation": "^2.3.1" + } + }, + "@octokit/request": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz", + "integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==", + "requires": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.0.0", + "@octokit/types": "^2.11.1", "deprecation": "^2.0.0", "is-plain-object": "^3.0.0", "node-fetch": "^2.3.0", "once": "^1.4.0", - "universal-user-agent": "^4.0.0" + "universal-user-agent": "^5.0.0" + }, + "dependencies": { + "universal-user-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", + "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", + "requires": { + "os-name": "^3.1.0" + } + } } }, "@octokit/request-error": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.0.tgz", - "integrity": "sha512-DNBhROBYjjV/I9n7A8kVkmQNkqFAMem90dSxqvPq57e2hBr7mNTX98y3R2zDpqMQHVRpBDjsvsfIGgBzy+4PAg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz", + "integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==", "requires": { "@octokit/types": "^2.0.0", "deprecation": "^2.0.0", @@ -974,11 +1016,14 @@ } }, "@octokit/rest": { - "version": "16.38.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.38.1.tgz", - "integrity": "sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==", + "version": "16.43.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz", + "integrity": "sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==", "requires": { "@octokit/auth-token": "^2.4.0", + "@octokit/plugin-paginate-rest": "^1.1.1", + "@octokit/plugin-request-log": "^1.0.0", + "@octokit/plugin-rest-endpoint-methods": "2.4.0", "@octokit/request": "^5.2.0", "@octokit/request-error": "^1.0.2", "atob-lite": "^2.0.0", @@ -991,12 +1036,24 @@ "octokit-pagination-methods": "^1.1.0", "once": "^1.4.0", "universal-user-agent": "^4.0.0" + }, + "dependencies": { + "@octokit/request-error": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz", + "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==", + "requires": { + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + } } }, "@octokit/types": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.1.1.tgz", - "integrity": "sha512-89LOYH+d/vsbDX785NOfLxTW88GjNd0lWRz1DVPVsZgg9Yett5O+3MOvwo7iHgvUwbFz0mf/yPIjBkUbs4kxoQ==", + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.12.2.tgz", + "integrity": "sha512-1GHLI/Jll3j6F0GbYyZPFTcHZMGjAiRfkTEoRUyaVVk2IWbDdwEiClAJvXzfXCDayuGSNCqAUH8lpjZtqW9GDw==", "requires": { "@types/node": ">= 8" } @@ -1083,9 +1140,9 @@ } }, "@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.13.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz", + "integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -6259,9 +6316,9 @@ } }, "universal-user-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz", - "integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", + "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", "requires": { "os-name": "^3.1.0" } @@ -6461,9 +6518,9 @@ "dev": true }, "windows-release": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", - "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz", + "integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==", "requires": { "execa": "^1.0.0" } diff --git a/package.json b/package.json index d6e28ca..2d37002 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ }, "homepage": "https://github.com/peter-evans/create-or-update-comment#readme", "dependencies": { - "@actions/core": "^1.1.1", - "@actions/github": "^2.0.0" + "@actions/core": "1.2.0", + "@actions/github": "2.0.1" }, "devDependencies": { "@zeit/ncc": "0.22.1", From dc99f6bd48945c11b38fcfa0ba21615caf1196a1 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 1 May 2020 19:25:58 +0900 Subject: [PATCH 3/3] Auto merge dev dependency updates --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renovate.json b/renovate.json index f45d8f1..90b4626 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,11 @@ { "extends": [ "config:base" + ], + "packageRules": [ + { + "depTypeList": ["devDependencies"], + "automerge": true + } ] }