diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 6b2eebf..6d59d42 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -15,6 +15,7 @@ on: permissions: contents: read + pull-requests: write concurrency: group: 'dprint' @@ -27,3 +28,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./ + with: + base-branch: 'main' + github-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/README.md b/README.md index 54b816c..ba94657 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ jobs: - uses: kachick/action-update-dprint-plugins@v0.1.0 with: base-branch: 'main' + github-token: "${{ secrets.GITHUB_TOKEN }}" # auto-merge: false # default: true ``` @@ -44,10 +45,11 @@ jobs: All options should be specified with string. So true/false should be 'true'/'false' -| name | default | options | description | -| ----------- | ------- | --------------- | ------------------------------------------------------------------------------ | -| base-branch | (null) | e.g 'main' | The branch into which you want updating PR merged | -| auto-merge | 'true' | 'true', 'false' | The updating PR will be auto merged if no change exist even after `dprint fmt` | +| name | default | options | description | +| ------------ | ------- | --------------------------------- | ------------------------------------------------------------------------------ | +| base-branch | (null) | e.g 'main' | The branch into which you want updating PR merged | +| github-token | (null) | e.g "${{ secrets.GITHUB_TOKEN }}" | The token will be used to create PR | +| auto-merge | 'true' | 'true', 'false' | The updating PR will be auto merged if no change exist even after `dprint fmt` | ## Motivation diff --git a/action.yml b/action.yml index 585d3f7..d455311 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,9 @@ inputs: base-branch: description: 'The branch into which you want updating PR merged' required: true + github-token: + description: 'The token will be used to create PR' + required: true auto-merge: description: 'The updating PR will be auto merged if no change exist even after `dprint fmt`' required: false @@ -43,7 +46,7 @@ runs: - name: Create PR run: gh pr create --fill --base ${{ inputs.base-branch}} env: - GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + GH_TOKEN: '${{ inputs.github-token }}' shell: bash # - name: Auto merge # run: ...