From 058e31d03b3d4a88505fc71d28538de655e073b5 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Mon, 20 Sep 2021 14:57:21 +0000 Subject: [PATCH] Add reviewdog/depup/with-pr action --- with-pr/action.yml | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 with-pr/action.yml diff --git a/with-pr/action.yml b/with-pr/action.yml new file mode 100644 index 0000000..6fcbaa2 --- /dev/null +++ b/with-pr/action.yml @@ -0,0 +1,63 @@ +name: 'Open PR automatically to updates dependencies' +description: 'Updates dependencies in code to latest semantic ver release. (e.g. TOOL_NAME_VERSION=0.9.17 in Dockerfile)' +author: 'haya14busa' +inputs: + github_token: + description: 'GITHUB_TOKEN to get latest version with GitHub Release API' + default: '${{ github.token }}' + file: + description: 'target file' + required: true + version_name: + description: 'target version name. e.g. REVIEWDOG_VERSION' + required: true + repo: + description: 'target GitHub repository. e.g. reviewdog/reviewdog' + required: true + tag: + description: 'Check tags instead of releases.' + default: 'false' + required: false + tag_prefix: + description: 'Tag prefix used for building link in PR description' + default: 'v' + required: false +outputs: + current: + description: 'current version' + value: ${{ steps.depup.outputs.current }} + latest: + description: 'latest version' + value: ${{ steps.depup.outputs.latest }} + repo: + description: 'target GitHub repository. Same as the repo from input.' + value: ${{ steps.depup.outputs.repo }} + +runs: + using: 'composite' + steps: + - name: reviewdog/action-depup + id: depup + uses: ./ + with: + github_token: ${{ inputs.github_token }} + file: ${{ inputs.file }} + version_name: ${{ inputs.version_name }} + repo: ${{ inputs.repo }} + tag: ${{ inputs.tag }} + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ inputs.github_token }} + title: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}" + commit-message: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}" + body: | + Update [${{ steps.depup.outputs.repo }}](https://github.com/${{ steps.depup.outputs.repo }}) to [${{ steps.depup.outputs.latest }}](https://github.com/${{ steps.depup.outputs.repo }}/releases/tag/${{ inputs.tag_prefix }}${{ steps.depup.outputs.latest }}) + This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3A${{ github.workflow }}). + branch: depup/${{ steps.depup.outputs.repo }} + base: ${{ github.event.repository.default_branch }} + +# Ref: https://haya14busa.github.io/github-action-brandings/ +branding: + icon: 'refresh-cw' + color: 'orange'