diff --git a/.github/actions/commit/action.yml b/.github/actions/commit/action.yml index 0aa47f4a..60003201 100644 --- a/.github/actions/commit/action.yml +++ b/.github/actions/commit/action.yml @@ -15,24 +15,26 @@ inputs: description: Branch to commit to PATTERN: required: false - default: '*.json *.md *.yaml *.yml *.lock' + default: '.' description: File pattern for adding to commits runs: using: composite steps: - - name: Print changed files - shell: bash - run: | - echo $(git status) + - name: Get GitHub App User ID + id: get-user-id + run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ inputs.GITHUB_TOKEN }} - name: Commit changes - uses: planetscale/ghcommit-action@v0.1.44 + uses: EndBug/add-and-commit@v9 env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} with: - repo: ${{ github.repository }} - branch: ${{ inputs.BRANCH }} - commit_message: ${{ inputs.COMMIT_MESSAGE }} - file_pattern: ${{ inputs.PATTERN }} + author_name: ${{ steps.get-user-id.outputs.app-slug }} + author_email: "${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>" + message: ${{ inputs.COMMIT_MESSAGE }} + add: ${{ inputs.PATTERN }} + commit: -S