diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..2583109 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,35 @@ +on: + push: + branches: + - main + pull_request: +name: ci +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [12, 14] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: node --version + # The first installation step ensures that all of our production + # dependencies work on the given Node.js version, this helps us find + # dependencies that don't match our engines field: + - run: npm install --production --engine-strict --ignore-scripts --no-package-lock + # Clean up the production install, before installing dev/production: + - run: rm -rf node_modules + - run: npm install + - run: npm test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 14 + - run: npm install + - run: npm test diff --git a/.github/workflows/conventional-label.yaml b/.github/workflows/conventional-label.yaml new file mode 100644 index 0000000..0507391 --- /dev/null +++ b/.github/workflows/conventional-label.yaml @@ -0,0 +1,12 @@ +on: + push: + branches: + - main + pull_request: + types: [ opened, edited ] +name: conventional-release-labels +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: bcoe/conventional-release-labels diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..3649a29 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,109 @@ +on: + push: + branches: + - main +name: release-please +env: + ACTION_NAME: conventional-release-labels +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install + run: npm ci + - name: build + run: npm run build + - name: commit + run: |- + set -e + # get current commit hash + CURRENT_HASH=$(git rev-parse HEAD) + # get last commit hash of last build dist + LAST_BUILD_HASH=$(git log --author=google-github-actions-bot -1 --pretty=format:"%H") + DIFF="" + # build and commit dist if diff + git config --global user.name "actions-bot" + git config user.email 'github-actions-bot@google.com' + git add dist/ + git diff-index --quiet HEAD || git commit -m "chore: build dist ${ACTION_NAME}" + # if last commit hash of last build dist was found, get logs of commits in btw for PR body + if [ -z "$LAST_BUILD_HASH" ] + then + echo "Unable to find last commit by bot, skipping diff gen" + else + DIFF=$(git log ${LAST_BUILD_HASH}...${CURRENT_HASH} --oneline) + echo $DIFF + fi + # set env vars + echo "CURRENT_HASH=${CURRENT_HASH}" >> $GITHUB_ENV + echo "LAST_BUILD_HASH=${LAST_BUILD_HASH}" >> $GITHUB_ENV + echo 'DIFF<> $GITHUB_ENV + echo "${DIFF}" >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV + - name: Create PR with dist + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Build dist + author: "actions-bot " + title: "chore: build dist" + body: | + Build dist PR + ${{env.DIFF}} + labels: automated pr + branch: create-pull-request/build-dist + delete-branch: true + push-to-fork: google-github-actions-bot/${{env.ACTION_NAME}} + release-please-pr: + runs-on: ubuntu-latest + needs: [build] + steps: + - id: release-pr + uses: GoogleCloudPlatform/release-please-action@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + fork: true + package-name: ${{env.ACTION_NAME}} + command: release-pr + - id: label + if: ${{ steps.release-pr.outputs.pr }} + uses: actions/github-script@v3 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); + await github.issues.addLabels({ + owner, + repo, + issue_number: ${{steps.release-pr.outputs.pr}}, + labels: ['autorelease: pending'] + }); + console.log(`Tagged ${{steps.release-pr.outputs.pr}}`) + release-please-release: + runs-on: ubuntu-latest + needs: [build] + steps: + - uses: GoogleCloudPlatform/release-please-action@main + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + package-name: ${{env.ACTION_NAME}} + command: github-release + - uses: actions/checkout@v2 + - name: tag major and patch versions + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN}}@github.com/google-github-actions/release-please-action.git" + git tag -d v${{ steps.release.outputs.major }} || true + git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git push origin :v${{ steps.release.outputs.major }} || true + git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" + git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" + git push origin v${{ steps.release.outputs.major }} + git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} + if: ${{ steps.release.outputs.release_created }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b600741 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +coverage +node_modules +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7a21802 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,673 @@ +# Changelog + +## [2.32.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.31.0...v2.32.0) (2021-09-13) + + +### Features + +* output list of paths released during manifest release ([#362](https://www.github.com/google-github-actions/release-please-action/issues/362)) ([670afac](https://www.github.com/google-github-actions/release-please-action/commit/670afac8ab682e158b4e390a3209d42346e72518)) + +## [2.31.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.30.0...v2.31.0) (2021-09-09) + + +### Features + +* adds elixir support ([#354](https://www.github.com/google-github-actions/release-please-action/issues/354)) ([59f4915](https://www.github.com/google-github-actions/release-please-action/commit/59f49151772e19ad5a5c7959831ce4252f538789)) + + +### Bug Fixes + +* `Unexpected input(s)` warning for inputs: `config-file` & `manifest-file` ([#356](https://www.github.com/google-github-actions/release-please-action/issues/356)) ([f19ddf2](https://www.github.com/google-github-actions/release-please-action/commit/f19ddf2fe64b11510b2a743ecb73af5bb693d79d)) +* **build:** action with support for PHP ([fd790a2](https://www.github.com/google-github-actions/release-please-action/commit/fd790a278caa544313600a3eb908e5ebaecc6cc5)) + +## [2.30.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.29.2...v2.30.0) (2021-08-25) + + +### Features + +* add support for simple php projects ([#344](https://www.github.com/google-github-actions/release-please-action/issues/344)) ([d6f40e4](https://www.github.com/google-github-actions/release-please-action/commit/d6f40e4317daf6906456fefc0d4c081dfe03b51d)) + +### [2.29.2](https://www.github.com/google-github-actions/release-please-action/compare/v2.29.1...v2.29.2) (2021-08-05) + + +### Bug Fixes + +* **relese-please:** rollback bad release ([#338](https://www.github.com/google-github-actions/release-please-action/issues/338)) ([68f6fc6](https://www.github.com/google-github-actions/release-please-action/commit/68f6fc67aa29c63452a09eba621445ce2c6dfcb7)) + +### [2.29.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.29.0...v2.29.1) (2021-08-04) + + +### Bug Fixes + +* **release-please:** buf fixes for pre-release versions ([#334](https://www.github.com/google-github-actions/release-please-action/issues/334)) ([d7f1090](https://www.github.com/google-github-actions/release-please-action/commit/d7f1090a7d15d4d583ae88a9c15b29aef294d022)) + +## [2.29.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.28.1...v2.29.0) (2021-07-28) + + +### Features + +* add release_created per path in manifest PR ([#310](https://www.github.com/google-github-actions/release-please-action/issues/310)) ([5f94ede](https://www.github.com/google-github-actions/release-please-action/commit/5f94ededed7a7a441d1c47eca064ec7aeda117ec)) +* **release-please:** update to release-please with rust mono-repo support ([#327](https://www.github.com/google-github-actions/release-please-action/issues/327)) ([4140ff7](https://www.github.com/google-github-actions/release-please-action/commit/4140ff739454a552bc374b97833ba8487a907c76)) + + +### Bug Fixes + +* support alternate CHANGELOG.md path ([#329](https://www.github.com/google-github-actions/release-please-action/issues/329)) ([3e6dc1e](https://www.github.com/google-github-actions/release-please-action/commit/3e6dc1e3aa39466a14ad5275b71e68b636f49285)) + +### [2.28.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.28.0...v2.28.1) (2021-06-20) + + +### Bug Fixes + +* **manifest:** if "." is used it should have same outputs as node ([#319](https://www.github.com/google-github-actions/release-please-action/issues/319)) ([d234c63](https://www.github.com/google-github-actions/release-please-action/commit/d234c634c289f2e3fe4398b9fe234dadaa2fb486)) + +## [2.28.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.27.0...v2.28.0) (2021-05-05) + + +### Features + +* **release-please:** upgrade to release-please@11.11.0 ([#305](https://www.github.com/google-github-actions/release-please-action/issues/305)) ([48a8af5](https://www.github.com/google-github-actions/release-please-action/commit/48a8af5a36a420b485e8ed31a58edfea61270446)) + +## [2.27.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.26.0...v2.27.0) (2021-05-04) + + +### Features + +* **release-please:** improved go release strategy ([#301](https://www.github.com/google-github-actions/release-please-action/issues/301)) ([0267b45](https://www.github.com/google-github-actions/release-please-action/commit/0267b45516a836f3d70c32fc0b70036b1ef84eed)) + +## [2.26.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.25.1...v2.26.0) (2021-04-29) + + +### Features + +* **release-please:** update of release-please ([#298](https://www.github.com/google-github-actions/release-please-action/issues/298)) ([5a49a61](https://www.github.com/google-github-actions/release-please-action/commit/5a49a61eb57b1aa3c977a90dedc86e7161ce2a58)) + +### [2.25.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.25.0...v2.25.1) (2021-04-25) + + +### Bug Fixes + +* **release-please:** update to release-please@11.8.1 ([#293](https://www.github.com/google-github-actions/release-please-action/issues/293)) ([4d8569b](https://www.github.com/google-github-actions/release-please-action/commit/4d8569bf77ccda4bebb9dd136251a08079b409c4)) + +## [2.25.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.24.1...v2.25.0) (2021-04-20) + + +### Features + +* **release-please:** update to release-please 11.8.0 ([#289](https://www.github.com/google-github-actions/release-please-action/issues/289)) ([cb319a9](https://www.github.com/google-github-actions/release-please-action/commit/cb319a998f09574d2e228c1a23dfd46830dd29ce)) + +### [2.24.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.24.0...v2.24.1) (2021-03-25) + + +### Bug Fixes + +* **release-please:** fixed bug with "." releaser ([#283](https://www.github.com/google-github-actions/release-please-action/issues/283)) ([fe52822](https://www.github.com/google-github-actions/release-please-action/commit/fe5282250cf3f28e6d85435afa452b663d02002b)) + +## [2.24.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.23.0...v2.24.0) (2021-03-25) + + +### Features + +* **manifest:** add manifest-pr command ([#280](https://www.github.com/google-github-actions/release-please-action/issues/280)) ([f48a175](https://www.github.com/google-github-actions/release-please-action/commit/f48a175f37213946490a27038ecf023326e09fb6)) + +## [2.23.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.22.0...v2.23.0) (2021-03-24) + + +### Features + +* manifest based releaser https://git.io/JmVD4 ([#273](https://www.github.com/google-github-actions/release-please-action/issues/273)) ([45c32cc](https://www.github.com/google-github-actions/release-please-action/commit/45c32ccd248469ba2567c6dfd45c3c4cd2a241b4)) +* **release-please:** update to release-please with manifest support ([#274](https://www.github.com/google-github-actions/release-please-action/issues/274)) ([82a3c7e](https://www.github.com/google-github-actions/release-please-action/commit/82a3c7ec92032e3d6774e37a95badf4ff1e89eec)) +* **release-please:** upgrade to release-please v11.4.0 ([#277](https://www.github.com/google-github-actions/release-please-action/issues/277)) ([80ebc45](https://www.github.com/google-github-actions/release-please-action/commit/80ebc4526172e282083faba234ebde7b3c3d6276)) + +## [2.22.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.21.0...v2.22.0) (2021-03-10) + + +### Features + +* **release-please:** upgrade release-please ([#269](https://www.github.com/google-github-actions/release-please-action/issues/269)) ([f92bb7e](https://www.github.com/google-github-actions/release-please-action/commit/f92bb7ea357f580e57bded5eede672f7778da56e)) + +## [2.21.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.20.1...v2.21.0) (2021-03-04) + + +### Features + +* add pull-request-title-pattern option ([#259](https://www.github.com/google-github-actions/release-please-action/issues/259)) ([d447fdb](https://www.github.com/google-github-actions/release-please-action/commit/d447fdb6322f194c2dd23e2d39c8bd419e3d8ab6)) + +### [2.20.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.20.0...v2.20.1) (2021-02-23) + + +### Bug Fixes + +* **release-please:** missing js-yaml dependency ([#254](https://www.github.com/google-github-actions/release-please-action/issues/254)) ([faf27ee](https://www.github.com/google-github-actions/release-please-action/commit/faf27eea7cfff4bb3dfe752f4f87c8e0b6e07378)) + +## [2.20.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.19.2...v2.20.0) (2021-02-23) + + +### Features + +* **release-please:** update to v11.0.0 of release please ([#250](https://www.github.com/google-github-actions/release-please-action/issues/250)) ([d7ed0b8](https://www.github.com/google-github-actions/release-please-action/commit/d7ed0b8f09544ebc80152b2f8b1b4736d2cb9b9b)) + +### [2.19.2](https://www.github.com/google-github-actions/release-please-action/compare/v2.19.1...v2.19.2) (2021-02-20) + + +### Bug Fixes + +* **release-please:** setup.py retains formatting ([#246](https://www.github.com/google-github-actions/release-please-action/issues/246)) ([038a2f3](https://www.github.com/google-github-actions/release-please-action/commit/038a2f320b92c8a4009d3fe7261fc34c6070b446)) + +### [2.19.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.19.0...v2.19.1) (2021-02-18) + + +### Bug Fixes + +* **config:** packageName is optional ([#239](https://www.github.com/google-github-actions/release-please-action/issues/239)) ([df8698c](https://www.github.com/google-github-actions/release-please-action/commit/df8698c999dd72a46a62b8421c1d20eaba363488)) +* fix workflow env missing bug ([#238](https://www.github.com/google-github-actions/release-please-action/issues/238)) ([0d18e74](https://www.github.com/google-github-actions/release-please-action/commit/0d18e7461f484869df6b9b604019d73f24291e9a)), closes [#237](https://www.github.com/google-github-actions/release-please-action/issues/237) + +## [2.19.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.18.1...v2.19.0) (2021-02-17) + + +### Features + +* **release-please:** add default token input option ([#212](https://www.github.com/google-github-actions/release-please-action/issues/212)) ([eea7db7](https://www.github.com/google-github-actions/release-please-action/commit/eea7db7fda9e26271d7bcd313f760e7443fee321)) + + +### Bug Fixes + +* get the correct boolean value of the input ([#233](https://www.github.com/google-github-actions/release-please-action/issues/233)) ([c23605f](https://www.github.com/google-github-actions/release-please-action/commit/c23605fcb2b0807911f30bf19060ddeda84e105a)) + +### [2.18.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.18.0...v2.18.1) (2021-02-15) + + +### Bug Fixes + +* **release-please:** update github-release call to new function ([#217](https://www.github.com/google-github-actions/release-please-action/issues/217)) ([efd1c77](https://www.github.com/google-github-actions/release-please-action/commit/efd1c77e85e3e407ac71c4eb338fc1aa86027455)) +* **release-please:** uses factory from latest version ([#222](https://www.github.com/google-github-actions/release-please-action/issues/222)) ([cede8e4](https://www.github.com/google-github-actions/release-please-action/commit/cede8e48374038ce478d27a172085187b4668923)) + +## [2.18.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.17.0...v2.18.0) (2021-02-12) + + +### Features + +* **release-please:** use latest release please version ([#210](https://www.github.com/google-github-actions/release-please-action/issues/210)) ([484099d](https://www.github.com/google-github-actions/release-please-action/commit/484099d9695e3107b5d0bab3f953ab900f69f9d8)) + +## [2.17.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.16.0...v2.17.0) (2021-02-05) + + +### Features + +* **release-please:** add default branch input option for github release ([#206](https://www.github.com/google-github-actions/release-please-action/issues/206)) ([534536c](https://www.github.com/google-github-actions/release-please-action/commit/534536c1c22bf1b590511b1ab65c732a67439212)) + +## [2.16.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.15.3...v2.16.0) (2021-02-02) + + +### Features + +* **release-please:** add default branch input option ([#202](https://www.github.com/google-github-actions/release-please-action/issues/202)) ([4845e49](https://www.github.com/google-github-actions/release-please-action/commit/4845e49098adfa5e7b79838e06aaf281778e9545)) + +### [2.15.3](https://www.github.com/google-github-actions/release-please-action/compare/v2.15.2...v2.15.3) (2021-01-22) + + +### Bug Fixes + +* **release-please:** uses alternate approach to find files in repo ([#198](https://www.github.com/google-github-actions/release-please-action/issues/198)) ([c540b9e](https://www.github.com/google-github-actions/release-please-action/commit/c540b9e79be1b629a02e961a539eea29c1e9e57a)) + +### [2.15.2](https://www.github.com/google-github-actions/release-please-action/compare/v2.15.1...v2.15.2) (2021-01-16) + + +### Bug Fixes + +* **pagination:** tagging can use 'updated' releases should use 'created' ([b5e370c](https://www.github.com/google-github-actions/release-please-action/commit/b5e370ce70ebd5db6cffa9e93327c62dbd29ffde)) +* **release-please:** fix whitespace issues in Rust ([#195](https://www.github.com/google-github-actions/release-please-action/issues/195)) ([b5e370c](https://www.github.com/google-github-actions/release-please-action/commit/b5e370ce70ebd5db6cffa9e93327c62dbd29ffde)) + +### [2.15.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.15.0...v2.15.1) (2021-01-15) + + +### Bug Fixes + +* **release-please:** paginate PRs by updated ([#192](https://www.github.com/google-github-actions/release-please-action/issues/192)) ([92f9818](https://www.github.com/google-github-actions/release-please-action/commit/92f9818112ba7b24ebe9629d519b12e93df6a0ab)) + +## [2.15.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.14.1...v2.15.0) (2021-01-12) + + +### Features + +* **release-please:** add support for ocaml ([#189](https://www.github.com/google-github-actions/release-please-action/issues/189)) ([c1aca05](https://www.github.com/google-github-actions/release-please-action/commit/c1aca052417abd8c2b0d1e68ce826282ae3b245a)) + +### [2.14.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.14.0...v2.14.1) (2021-01-12) + + +### Bug Fixes + +* README.md typos ([#186](https://www.github.com/google-github-actions/release-please-action/issues/186)) ([e363460](https://www.github.com/google-github-actions/release-please-action/commit/e36346079c94b226b38a19d018ca6cdc044080e0)) +* **release-please:** fixes for monorepo path handling ([#181](https://www.github.com/google-github-actions/release-please-action/issues/181)) ([349920d](https://www.github.com/google-github-actions/release-please-action/commit/349920da705ae2434e49ea95bd1c90238b71aafa)) +* **release-please:** handle missing packageName release-pr ([#184](https://www.github.com/google-github-actions/release-please-action/issues/184)) ([88127ca](https://www.github.com/google-github-actions/release-please-action/commit/88127ca26bc402aaf2d7e9f2182035ad2e81b417)) +* **release-please:** increase page size for release PRs ([#187](https://www.github.com/google-github-actions/release-please-action/issues/187)) ([abdb363](https://www.github.com/google-github-actions/release-please-action/commit/abdb3633221dfc822423679ad246db4e1b048fff)) + +## [2.14.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.13.0...v2.14.0) (2021-01-08) + + +### Features + +* **release-please:** add support for Rust ([#177](https://www.github.com/google-github-actions/release-please-action/issues/177)) ([fce09f2](https://www.github.com/google-github-actions/release-please-action/commit/fce09f2994e8c6711169af3c92fdfda15fa30f05)) + +## [2.13.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.12.3...v2.13.0) (2020-12-29) + + +### Features + +* **release-please:** fallback tag check is looser ([#169](https://www.github.com/google-github-actions/release-please-action/issues/169)) ([46292e5](https://www.github.com/google-github-actions/release-please-action/commit/46292e55636f49995766fb1bb9ef1b0aaaf21aa7)) + +### [2.12.3](https://www.github.com/google-github-actions/release-please-action/compare/v2.12.2...v2.12.3) (2020-12-18) + + +### Bug Fixes + +* **release-please:** stop dynamically loading releasers ([#165](https://www.github.com/google-github-actions/release-please-action/issues/165)) ([4de8d4a](https://www.github.com/google-github-actions/release-please-action/commit/4de8d4ac44ed9d0a8d20386d68169b86b30d798a)) + +### [2.12.2](https://www.github.com/google-github-actions/release-please-action/compare/v2.12.1...v2.12.2) (2020-12-10) + + +### Bug Fixes + +* **go:** pass release-type ([#160](https://www.github.com/google-github-actions/release-please-action/issues/160)) ([5c5271c](https://www.github.com/google-github-actions/release-please-action/commit/5c5271ce75fb1e7955fddc806b9260163206aa27)) + +### [2.12.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.12.0...v2.12.1) (2020-12-10) + + +### Bug Fixes + +* **release-please:** map go to alternate tag separator ([#157](https://www.github.com/google-github-actions/release-please-action/issues/157)) ([bdc110f](https://www.github.com/google-github-actions/release-please-action/commit/bdc110f19e7d011ed957f41b21f69b3005d151c1)) + +## [2.12.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.11.5...v2.12.0) (2020-12-10) + + +### Features + +* allow changelogPath to be specified ([#153](https://www.github.com/google-github-actions/release-please-action/issues/153)) ([10d7619](https://www.github.com/google-github-actions/release-please-action/commit/10d761994342597b3e1d24464a41d28d5d97abe3)) + +### [2.11.5](https://www.github.com/google-github-actions/release-please-action/compare/v2.11.4...v2.11.5) (2020-12-08) + + +### Bug Fixes + +* **go:** non-gapic/apiary libraries now bump patch ([#150](https://www.github.com/google-github-actions/release-please-action/issues/150)) ([00fefb4](https://www.github.com/google-github-actions/release-please-action/commit/00fefb4ff917a53cb65ed27c14c0586ef9055b37)) + +### [2.11.4](https://www.github.com/google-github-actions/release-please-action/compare/v2.11.3...v2.11.4) (2020-12-07) + + +### Bug Fixes + +* **go:** first commit sha was not being stored ([b555656](https://www.github.com/google-github-actions/release-please-action/commit/b5556569e8852edb74aadc6aff8bd9315d600689)) + +### [2.11.3](https://www.github.com/google-github-actions/release-please-action/compare/v2.11.2...v2.11.3) (2020-12-07) + + +### Bug Fixes + +* **go:** filter additional PRs from gapic repo ([#145](https://www.github.com/google-github-actions/release-please-action/issues/145)) ([b02ff3b](https://www.github.com/google-github-actions/release-please-action/commit/b02ff3b568326db3e85a5249ae37e33c39dd4563)) + +### [2.11.2](https://www.github.com/google-github-actions/release-please-action/compare/v2.11.1...v2.11.2) (2020-12-07) + + +### Bug Fixes + +* **go:** pass monorepoTags when opening PR ([#142](https://www.github.com/google-github-actions/release-please-action/issues/142)) ([3428252](https://www.github.com/google-github-actions/release-please-action/commit/34282521f08daa0962fba0a8d98936286a0b2896)) + +### [2.11.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.11.0...v2.11.1) (2020-12-07) + + +### Bug Fixes + +* **release-please:** fixed branch detection logic for ruby ([#139](https://www.github.com/google-github-actions/release-please-action/issues/139)) ([cd052f4](https://www.github.com/google-github-actions/release-please-action/commit/cd052f41cb6dce082f59e9edad966004813dcdc5)) + +## [2.11.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.10.1...v2.11.0) (2020-12-07) + + +### Features + +* **release-please:** upgrade to relese-please with go support ([#133](https://www.github.com/google-github-actions/release-please-action/issues/133)) ([5703b0f](https://www.github.com/google-github-actions/release-please-action/commit/5703b0fdec00d70d4be84f7d1a98b3e5adb738ec)) + + +### Bug Fixes + +* do not set PR output, if no PR opened ([#129](https://www.github.com/google-github-actions/release-please-action/issues/129)) ([b0faf1d](https://www.github.com/google-github-actions/release-please-action/commit/b0faf1dd7d65697a12321df74e57458262513d70)) + +### [2.10.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.10.0...v2.10.1) (2020-12-03) + + +### Bug Fixes + +* fix readme typo ([#125](https://www.github.com/google-github-actions/release-please-action/issues/125)) ([d5b0c35](https://www.github.com/google-github-actions/release-please-action/commit/d5b0c3523e4cae31bc0a75685616e21df3197a90)) +* **release-please:** fix for merge commits ([#126](https://www.github.com/google-github-actions/release-please-action/issues/126)) ([35f9456](https://www.github.com/google-github-actions/release-please-action/commit/35f94566f5857aafe9fdaad7b2e7df122aac5a92)) + +## [2.10.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.9.3...v2.10.0) (2020-12-01) + + +### Features + +* **deps:** latest version of release-please ([#122](https://www.github.com/google-github-actions/release-please-action/issues/122)) ([5469575](https://www.github.com/google-github-actions/release-please-action/commit/54695753296b6274758664da88a333e49528635a)) + +### [2.9.3](https://www.github.com/google-github-actions/release-please-action/compare/v2.9.2...v2.9.3) (2020-11-25) + + +### Bug Fixes + +* **release-please:** don't add labels from fork ([13bffc3](https://www.github.com/google-github-actions/release-please-action/commit/13bffc3e974a8edf5d4830257a17d40e9cb9a32f)) + +### [2.9.2](https://www.github.com/google-github-actions/release-please-action/compare/v2.9.1...v2.9.2) (2020-11-25) + + +### Bug Fixes + +* parse false value for clean ([fc5b3e5](https://www.github.com/google-github-actions/release-please-action/commit/fc5b3e5c11baace865aed65127f107a4d8b392da)) + +### [2.9.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.9.0...v2.9.1) (2020-11-25) + + +### Bug Fixes + +* **build:** attempt to ignore errors ([15d0718](https://www.github.com/google-github-actions/release-please-action/commit/15d0718b84b06b34d9125a5d7e97b38888480f99)) + +## [2.9.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.8.2...v2.9.0) (2020-11-25) + + +### Features + +* pass monorepoTags and packageName when creating GitHub release ([#112](https://www.github.com/google-github-actions/release-please-action/issues/112)) ([69af5fc](https://www.github.com/google-github-actions/release-please-action/commit/69af5fc7d9bb0977586102a0e1488abab7fdaace)) + + +### Bug Fixes + +* **build:** add message to tag ([b467439](https://www.github.com/google-github-actions/release-please-action/commit/b46743913ea2c717e2a144864cd026c3f2df4029)) + +### [2.8.2](https://www.github.com/google-github-actions/release-please-action/compare/v2.8.1...v2.8.2) (2020-11-25) + + +### Bug Fixes + +* **build:** configure git checkout step ([ff5dfe1](https://www.github.com/google-github-actions/release-please-action/commit/ff5dfe1653289b33b5fb3e5de72e0b3733ff390d)) +* **build:** run latest dist ([799e6de](https://www.github.com/google-github-actions/release-please-action/commit/799e6de570879ef6ad3d7067295b3e0c2c837e04)) + +### [2.8.1](https://www.github.com/google-github-actions/release-please-action/compare/v2.8.0...v2.8.1) (2020-11-25) + + +### Bug Fixes + +* **build:** working on version of build that tags major/minor release line ([d4814fe](https://www.github.com/google-github-actions/release-please-action/commit/d4814feca529141f25d8c871b3c2d093b38c14c8)) + +## [2.8.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.7.0...v2.8.0) (2020-11-25) + + +### Features + +* add additional outputs ([#106](https://www.github.com/google-github-actions/release-please-action/issues/106)) ([c0f7d24](https://www.github.com/google-github-actions/release-please-action/commit/c0f7d24cd04488b7e14836d90143850b97aefadd)) + +## [2.7.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.6.0...v2.7.0) (2020-11-19) + + +### Features + +* **deps:** upgrade to release-please 6.9.0 ([#100](https://www.github.com/google-github-actions/release-please-action/issues/100)) ([40aba5e](https://www.github.com/google-github-actions/release-please-action/commit/40aba5e11684d69de9f36e60e19de0c5aa28750b)) + +## [2.6.0](https://www.github.com/google-github-actions/release-please-action/compare/v2.5.7...v2.6.0) (2020-11-08) + + +### Features + +* **deps:** upgrade to release-please 6.7.0 ([#95](https://www.github.com/google-github-actions/release-please-action/issues/95)) ([6461ef3](https://www.github.com/google-github-actions/release-please-action/commit/6461ef332678b2989b09860f8d6b0652cd7a8432)) + +### [2.5.7](https://www.github.com/google-github-actions/release-please-action/compare/v2.5.6...v2.5.7) (2020-10-29) + + +### Bug Fixes + +* **ruby:** properly support ruby release process ([#92](https://www.github.com/google-github-actions/release-please-action/issues/92)) ([6c289af](https://www.github.com/google-github-actions/release-please-action/commit/6c289af7b611b6019c67c2285397d905380962ac)) + +### [2.5.6](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.5.5...v2.5.6) (2020-10-15) + + +### Bug Fixes + +* **release-please:** fallback to tag ([#89](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/89)) ([c6f1cd6](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/c6f1cd680fabd9729dc13f6bde59ed5160acb9a3)) + +### [2.5.5](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.5.4...v2.5.5) (2020-10-10) + + +### Bug Fixes + +* **docs:** document functional version of release-please ([0ab3b32](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/0ab3b3257c9f07aa7e7f2ef5b843556b277b53f5)) + +### [2.5.4](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.5.3...v2.5.4) (2020-10-10) + + +### Bug Fixes + +* **release-please:** last release had undefined ordering behavior ([a4b349d](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/a4b349d8a8462722f0d1c246581650a4788b76ee)) + +### [2.5.3](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.5.2...v2.5.3) (2020-10-09) + + +### Bug Fixes + +* **docs:** indicate correct version ([#84](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/84)) ([b632af4](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/b632af41016a545a6e7ee6ecd9b9325538c88e28)) + +### [2.5.2](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.5.1...v2.5.2) (2020-10-09) + + +### Bug Fixes + +* **release-please:** sort commits ([#82](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/82)) ([846f33a](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/846f33aee4836826ed78a893aa7c1bbd46da6bd4)) + +### [2.5.1](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.5.0...v2.5.1) (2020-10-08) + + +### Bug Fixes + +* **build:** use new release strategy ([646de90](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/646de90a87173de7b76c7d83807348c2b05b3e43)) + +## [2.5.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.4.2...v2.5.0) (2020-10-08) + + +### Features + +* **deps:** release-please with support for alternate release branches ([#79](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/79)) ([dfe6b62](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/dfe6b622584ce774821ae93012eda87a2ad9d8a5)) + + +### Bug Fixes + +* **build:** revert build to non-debug form ([e6f39a1](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/e6f39a1ff2137720a77acef0b92a813658920fa4)) + +### [2.4.2](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.4.1...v2.4.2) (2020-10-01) + + +### Bug Fixes + +* **deps:** bump @actions/core from 1.2.4 to 1.2.6 ([#76](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/76)) ([fa86b83](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/fa86b83b5666ef0319c5508ded6b43af2cdf317b)) + +### [2.4.1](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.4.0...v2.4.1) (2020-09-17) + + +### Bug Fixes + +* **build:** document working version of release-please ([60ae28e](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/60ae28e4b20929fc93a249186726c13098fd6019)) + +## [2.4.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.3.0...v2.4.0) (2020-09-17) + + +### Features + +* allow github-release/release-pr to be run separately ([#70](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/70)) ([37d423f](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/37d423feba66be7be541aa122419aee5b50fdf98)) + + +### Bug Fixes + +* default changelog sections to undefined ([31e1a25](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/31e1a25ccf4f8df92fdb4066e3650a6167e5fe25)) +* **build:** release from fork ([f2bda04](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/f2bda04bb55ac6fdaf5e3673a78323966a3768b5)) + +## [2.3.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.2.0...v2.3.0) (2020-09-17) + + +### Features + +* **release-please:** now supports large files; introduces fork option ([#67](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/67)) ([e7d31db](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/e7d31db9262f11895e7938b84f049e2d6a31be4f)) + +## [2.2.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.1.1...v2.2.0) (2020-09-10) + + +### Features + +* Add a changelog section type ([#64](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/64)) ([2ca6d30](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/2ca6d30396e3b6b10ca9623ecbc3174b476ec8a2)) + + +### Bug Fixes + +* **release-please:** release please with code-suggester bug fixes ([#66](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/66)) ([6b79987](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/6b79987e9000e7617d81e9645c8394f27b396a8d)) + +### [2.1.1](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.1.0...v2.1.1) (2020-09-06) + + +### Bug Fixes + +* do not try to fork ([#62](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/62)) ([139a5ef](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/139a5efd7c7e8161ddaa5d5f0f3a80be2e2af96a)) + +## [2.1.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v2.0.0...v2.1.0) (2020-09-05) + + +### Features + +* **build:** document and update to 2.x ([#59](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/59)) ([512c940](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/512c940c3aa1d2569b540b05472636550d772946)) + + +### Bug Fixes + +* hot fix for permission issues in code suggester ([#61](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/61)) ([1b9bcd5](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/1b9bcd506ca8e69c807f51b7be7433c2b2b6bc96)) + +## [2.0.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.6.3...v2.0.0) (2020-09-04) + + +### ⚠ BREAKING CHANGES + +* moves to code-suggester for PR management (#57) + +### Features + +* moves to code-suggester for PR management ([#57](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/57)) ([1875a0a](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/1875a0accd4910cdeed87ee0d05c376f71b9d155)) + +### [1.6.3](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.6.2...v1.6.3) (2020-08-02) + + +### Bug Fixes + +* path was sometimes empty string ([37d7741](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/37d774119e97ee91ab924fc3e30902a38a64c6bb)) + +### [1.6.2](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.6.1...v1.6.2) (2020-08-02) + + +### Bug Fixes + +* falsy path should be passed as undefined ([#54](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/54)) ([21233d3](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/21233d3c9f239105feab8f1df3e5fb013c1bd7f8)) + +### [1.6.1](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.6.0...v1.6.1) (2020-07-28) + + +### Bug Fixes + +* add missing path and monorepo-tags options ([#52](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/52)) ([41fbc62](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/41fbc62bb12a4b0ff33a3ae5f401acc3d1bf3b7f)) + +## [1.6.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.5.0...v1.6.0) (2020-07-27) + + +### Features + +* adds support for releases from alternate paths ([#50](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/50)) ([6fc9b14](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/6fc9b14e82521ecefd65c6b7f6b4f32561ce35f6)) + + +### Bug Fixes + +* run tests on release PRs ([#47](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/47)) ([b4c1bd2](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/b4c1bd25c7ff2d17dcdd9a91d018dc7058c654a8)) + +## [1.5.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.4.0...v1.5.0) (2020-07-23) + + +### Features + +* **release-please:** auth gets; stop skipping all ci/cd ([#45](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/45)) ([367f112](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/367f112c21cbef9eef1ec197173f276b42b2fcbf)) + +## [1.4.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.3.2...v1.4.0) (2020-07-23) + + +### Features + +* output tag name and upload url ([#43](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/43)) ([90469b0](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/90469b02b471d8f7cba6c353b4c1ec1bab5bcde4)) + +### [1.3.2](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.3.1...v1.3.2) (2020-06-17) + + +### Bug Fixes + +* **build:** switch to GITHUB_TOKEN ([#38](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/38)) ([188d363](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/188d36320b0644bc436b701963d78be6386fe2c3)) + +### [1.3.1](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.3.0...v1.3.1) (2020-06-17) + + +### Bug Fixes + +* **build:** update to match new default branch ([#36](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/36)) ([1188197](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/1188197913717dd90bc1d79e1139269f427411e9)) + +## [1.3.0](https://www.github.com/GoogleCloudPlatform/release-please-action/compare/v1.2.2...v1.3.0) (2020-06-17) + + +### Features + +* **release-please:** configurable default branch; package-lock.json now updated ([#34](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/34)) ([a4607bd](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/a4607bde22b13d1ff7f153625f6e9c84ddf20a41)) + + +### Bug Fixes + +* **docs:** update docs to GoogleCloudPlatform ([#31](https://www.github.com/GoogleCloudPlatform/release-please-action/issues/31)) ([4f72a02](https://www.github.com/GoogleCloudPlatform/release-please-action/commit/4f72a02b61bc06a7607189ce5eea318ac382d242)) + +### [1.2.2](https://www.github.com/bcoe/release-please-action/compare/v1.2.1...v1.2.2) (2020-06-11) + + +### Bug Fixes + +* **deps:** depend on release-please ^5.2.1 to support merge commits ([#28](https://www.github.com/bcoe/release-please-action/issues/28)) ([5c2e7c4](https://www.github.com/bcoe/release-please-action/commit/5c2e7c41fc2a838bdd1c4319f18385e4784b020f)) + +### [1.2.1](https://www.github.com/bcoe/release-please-action/compare/v1.2.0...v1.2.1) (2020-05-21) + + +### Bug Fixes + +* use the static build helper ([6872559](https://www.github.com/bcoe/release-please-action/commit/687255987d0e25878a9d56fd69de09c232bbcea3)) + +## [1.2.0](https://www.github.com/bcoe/release-please-action/compare/v1.1.0...v1.2.0) (2020-05-21) + + +### Features + +* output whether or not a release was created ([#24](https://www.github.com/bcoe/release-please-action/issues/24)) ([b80ca61](https://www.github.com/bcoe/release-please-action/commit/b80ca61e2612c87bad38d85451c7f696a040bdc8)) + +## [1.1.0](https://www.github.com/bcoe/release-please-action/compare/v1.0.1...v1.1.0) (2020-05-20) + + +### Features + +* Add `bump-minor-pre-major` option ([#9](https://www.github.com/bcoe/release-please-action/issues/9)) ([788c495](https://www.github.com/bcoe/release-please-action/commit/788c495e2607702ce5ab41e9e246161d07fe8854)) + +### [1.0.1](https://www.github.com/bcoe/release-please-action/compare/v1.0.0...v1.0.1) (2020-05-09) + + +### Bug Fixes + +* pass token to create release ([3ad91fa](https://www.github.com/bcoe/release-please-action/commit/3ad91fa6cb8cf2c05464672da14cbea65555e5a2)) + +## 1.0.0 (2020-05-09) + + +### ⚠ BREAKING CHANGES + +* initial implementation of logic for running release please + +### Features + +* handle creating releases ([#3](https://www.github.com/bcoe/release-please-action/issues/3)) ([e72afe0](https://www.github.com/bcoe/release-please-action/commit/e72afe059a2eae50d319b3a4cee2a31479886fe8)) +* initial implementation of logic for running release please ([196390b](https://www.github.com/bcoe/release-please-action/commit/196390b8667a14c2ab16f53ba086c11afee28327)) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..dcb149d --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Release Please Action + +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) + +## License + +Apache Version 2.0 diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..20b9a5e --- /dev/null +++ b/action.yml @@ -0,0 +1,12 @@ +name: 'conventional-release-labels' +description: 'automatically apply release labels to PR, based on conventionalcommits.org' +author: Google LLC +inputs: + token: + description: 'GitHub token for applying labels, defaults to using secrets.GITHUB_TOKEN' + required: false + default: ${{ github.token }} + +runs: + using: 'node14' + main: 'dist/index.js' diff --git a/dist/index.mjs b/dist/index.mjs new file mode 100644 index 0000000..93d4ebf --- /dev/null +++ b/dist/index.mjs @@ -0,0 +1,2803 @@ +import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; +/******/ var __webpack_modules__ = ({ + +/***/ 861: +/***/ ((__webpack_module__, __webpack_exports__, __nccwpck_require__) => { + +"use strict"; +__nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__) => { +/* harmony export */ __nccwpck_require__.d(__webpack_exports__, { +/* harmony export */ "U": () => (/* binding */ isPullRequest) +/* harmony export */ }); +/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(186); +/* harmony import */ var _conventional_commits_parser__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(523); + + +// const signoff = core.getInput('signoff') || undefined +// core.setOutput('pr', pr) + + + +async function main() { + if (!process.env.GITHUB_EVENT_PATH) { + console.warn('no event payload found') + return + } + const payload = JSON.parse( + await readFile(process.env.GITHUB_EVENT_PATH, 'utf8') + ) + const ast = (0,_conventional_commits_parser__WEBPACK_IMPORTED_MODULE_1__.parser)('feat(parser): add support for scopes') + + if (!api.isPullRequest(payload)) { + console.info('skipping non pull_request') + return + } +} + +function isPullRequest(payload) { + return !!payload?.pull_request?.head +} + +try { + await main() +} catch (err) { + _actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(err.message); +} + +__webpack_handle_async_dependencies__(); +}, 1); + +/***/ }), + +/***/ 351: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.issue = exports.issueCommand = void 0; +const os = __importStar(__nccwpck_require__(87)); +const utils_1 = __nccwpck_require__(278); +/** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); +} +exports.issueCommand = issueCommand; +function issue(name, message = '') { + issueCommand(name, {}, message); +} +exports.issue = issue; +const CMD_STRING = '::'; +class Command { + constructor(command, properties, message) { + if (!command) { + command = 'missing.command'; + } + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; + } +} +function escapeData(s) { + return utils_1.toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} +function escapeProperty(s) { + return utils_1.toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A') + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); +} +//# sourceMappingURL=command.js.map + +/***/ }), + +/***/ 186: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; +const command_1 = __nccwpck_require__(351); +const file_command_1 = __nccwpck_require__(717); +const utils_1 = __nccwpck_require__(278); +const os = __importStar(__nccwpck_require__(87)); +const path = __importStar(__nccwpck_require__(622)); +const oidc_utils_1 = __nccwpck_require__(41); +/** + * The code to exit an action + */ +var ExitCode; +(function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +//----------------------------------------------------------------------- +// Variables +//----------------------------------------------------------------------- +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function exportVariable(name, val) { + const convertedVal = utils_1.toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); + } + else { + command_1.issueCommand('set-env', { name }, convertedVal); + } +} +exports.exportVariable = exportVariable; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ +function setSecret(secret) { + command_1.issueCommand('add-mask', {}, secret); +} +exports.setSecret = setSecret; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ +function addPath(inputPath) { + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); + } + else { + command_1.issueCommand('add-path', {}, inputPath); + } + process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; +} +exports.addPath = addPath; +/** + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ +function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); +} +exports.getInput = getInput; +/** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ +function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split('\n') + .filter(x => x !== ''); + return inputs; +} +exports.getMultilineInput = getMultilineInput; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ +function getBooleanInput(name, options) { + const trueValue = ['true', 'True', 'TRUE']; + const falseValue = ['false', 'False', 'FALSE']; + const val = getInput(name, options); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +exports.getBooleanInput = getBooleanInput; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setOutput(name, value) { + process.stdout.write(os.EOL); + command_1.issueCommand('set-output', { name }, value); +} +exports.setOutput = setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +function setCommandEcho(enabled) { + command_1.issue('echo', enabled ? 'on' : 'off'); +} +exports.setCommandEcho = setCommandEcho; +//----------------------------------------------------------------------- +// Results +//----------------------------------------------------------------------- +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); +} +exports.setFailed = setFailed; +//----------------------------------------------------------------------- +// Logging Commands +//----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ +function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; +} +exports.isDebug = isDebug; +/** + * Writes debug message to user log + * @param message debug message + */ +function debug(message) { + command_1.issueCommand('debug', {}, message); +} +exports.debug = debug; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function error(message, properties = {}) { + command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +exports.error = error; +/** + * Adds a warning issue + * @param message warning issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function warning(message, properties = {}) { + command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +exports.warning = warning; +/** + * Adds a notice issue + * @param message notice issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ +function notice(message, properties = {}) { + command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +exports.notice = notice; +/** + * Writes info to log with console.log. + * @param message info message + */ +function info(message) { + process.stdout.write(message + os.EOL); +} +exports.info = info; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ +function startGroup(name) { + command_1.issue('group', name); +} +exports.startGroup = startGroup; +/** + * End an output group. + */ +function endGroup() { + command_1.issue('endgroup'); +} +exports.endGroup = endGroup; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ +function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } + finally { + endGroup(); + } + return result; + }); +} +exports.group = group; +//----------------------------------------------------------------------- +// Wrapper action state +//----------------------------------------------------------------------- +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function saveState(name, value) { + command_1.issueCommand('save-state', { name }, value); +} +exports.saveState = saveState; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ +function getState(name) { + return process.env[`STATE_${name}`] || ''; +} +exports.getState = getState; +function getIDToken(aud) { + return __awaiter(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); +} +exports.getIDToken = getIDToken; +//# sourceMappingURL=core.js.map + +/***/ }), + +/***/ 717: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// For internal use, subject to change. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.issueCommand = void 0; +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__nccwpck_require__(747)); +const os = __importStar(__nccwpck_require__(87)); +const utils_1 = __nccwpck_require__(278); +function issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); +} +exports.issueCommand = issueCommand; +//# sourceMappingURL=file-command.js.map + +/***/ }), + +/***/ 41: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.OidcClient = void 0; +const http_client_1 = __nccwpck_require__(925); +const auth_1 = __nccwpck_require__(702); +const core_1 = __nccwpck_require__(186); +class OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); + } + static getRequestToken() { + const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; + if (!token) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); + } + return token; + } + static getIDTokenUrl() { + const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; + if (!runtimeUrl) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); + } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const httpclient = OidcClient.createHttpClient(); + const res = yield httpclient + .getJson(id_token_url) + .catch(error => { + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n + Error Message: ${error.result.message}`); + }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error('Response json body do not have ID Token field'); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter(this, void 0, void 0, function* () { + try { + // New ID Token is requested from action service + let id_token_url = OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + core_1.debug(`ID token url is ${id_token_url}`); + const id_token = yield OidcClient.getCall(id_token_url); + core_1.setSecret(id_token); + return id_token; + } + catch (error) { + throw new Error(`Error message: ${error.message}`); + } + }); + } +} +exports.OidcClient = OidcClient; +//# sourceMappingURL=oidc-utils.js.map + +/***/ }), + +/***/ 278: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toCommandProperties = exports.toCommandValue = void 0; +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +/** + * + * @param annotationProperties + * @returns The command properties to send with the actual annotation command + * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 + */ +function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; +} +exports.toCommandProperties = toCommandProperties; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 702: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + options.headers['Authorization'] = + 'Basic ' + + Buffer.from(this.username + ':' + this.password).toString('base64'); + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + options.headers['Authorization'] = 'Bearer ' + this.token; + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + options.headers['Authorization'] = + 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64'); + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + + +/***/ }), + +/***/ 925: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const http = __nccwpck_require__(605); +const https = __nccwpck_require__(211); +const pm = __nccwpck_require__(443); +let tunnel; +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers = exports.Headers || (exports.Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); +/** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ +function getProxyUrl(serverUrl) { + let proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; +} +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } +} +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return new Promise(async (resolve, reject) => { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + }); + } +} +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + let parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; +} +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } + } + options(requestUrl, additionalHeaders) { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + } + get(requestUrl, additionalHeaders) { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + } + del(requestUrl, additionalHeaders) { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + } + post(requestUrl, data, additionalHeaders) { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + } + patch(requestUrl, data, additionalHeaders) { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + } + put(requestUrl, data, additionalHeaders) { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + } + head(requestUrl, additionalHeaders) { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return this.request(verb, requestUrl, stream, additionalHeaders); + } + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + async getJson(requestUrl, additionalHeaders = {}) { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + let res = await this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async postJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async putJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async patchJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + async request(verb, requestUrl, data, headers) { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + let parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + while (numTries < maxTries) { + response = await this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (let i = 0; i < this.handlers.length; i++) { + if (this.handlers[i].canHandleAuthentication(response)) { + authenticationHandler = this.handlers[i]; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + let parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol == 'https:' && + parsedUrl.protocol != parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + await response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (let header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = await this.requestRaw(info, data); + redirectsRemaining--; + } + if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + await response.readBody(); + await this._performExponentialBackoff(numTries); + } + } + return response; + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return new Promise((resolve, reject) => { + let callbackForResult = function (err, res) { + if (err) { + reject(err); + } + resolve(res); + }; + this.requestRawWithCallback(info, data, callbackForResult); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + let socket; + if (typeof data === 'string') { + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + let handleResult = (err, res) => { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + }; + let req = info.httpModule.request(info.options, (msg) => { + let res = new HttpClientResponse(msg); + handleResult(null, res); + }); + req.on('socket', sock => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error('Request timeout: ' + info.options.path), null); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err, null); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + let parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + this.handlers.forEach(handler => { + handler.prepareRequest(info.options); + }); + } + return info; + } + _mergeHeaders(headers) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + let proxyUrl = pm.getProxyUrl(parsedUrl); + let useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (this._keepAlive && !useProxy) { + agent = this._agent; + } + // if agent is already assigned use that agent. + if (!!agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (!!this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + if (useProxy) { + // If using proxy, need tunnel + if (!tunnel) { + tunnel = __nccwpck_require__(294); + } + const agentOptions = { + maxSockets: maxSockets, + keepAlive: this._keepAlive, + proxy: { + ...((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + }), + host: proxyUrl.hostname, + port: proxyUrl.port + } + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; + } + _performExponentialBackoff(retryNumber) { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + } + static dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + let a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + async _processResponse(res, options) { + return new Promise(async (resolve, reject) => { + const statusCode = res.message.statusCode; + const response = { + statusCode: statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode == HttpCodes.NotFound) { + resolve(response); + } + let obj; + let contents; + // get the result from the body + try { + contents = await res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = 'Failed request: (' + statusCode + ')'; + } + let err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } + else { + resolve(response); + } + }); + } +} +exports.HttpClient = HttpClient; + + +/***/ }), + +/***/ 443: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +function getProxyUrl(reqUrl) { + let usingSsl = reqUrl.protocol === 'https:'; + let proxyUrl; + if (checkBypass(reqUrl)) { + return proxyUrl; + } + let proxyVar; + if (usingSsl) { + proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + if (proxyVar) { + proxyUrl = new URL(proxyVar); + } + return proxyUrl; +} +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; + } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } + else if (reqUrl.protocol === 'http:') { + reqPort = 80; + } + else if (reqUrl.protocol === 'https:') { + reqPort = 443; + } + // Format the request hostname and hostname with port + let upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (let upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperReqHosts.some(x => x === upperNoProxyItem)) { + return true; + } + } + return false; +} +exports.checkBypass = checkBypass; + + +/***/ }), + +/***/ 523: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parser = __nccwpck_require__(20) +const { toConventionalChangelogFormat } = __nccwpck_require__(269) + +module.exports = { + parser, + toConventionalChangelogFormat +} + + +/***/ }), + +/***/ 745: +/***/ ((module) => { + +module.exports = { + CR: '\u000d', + LF: '\u000a', + ZWNBSP: '\ufeff', + TAB: '\u0009', + VT: '\u000b', + FF: '\u000c', + SP: '\u0020', + NBSP: '\u00a0' +} + + +/***/ }), + +/***/ 20: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Scanner = __nccwpck_require__(44) +const { isWhitespace, isNewline, isParens } = __nccwpck_require__(915) + +/* + * ::= , +, , (+,