Skip to content

Commit

Permalink
Merge pull request #403 from atls/fix/github-commit
Browse files Browse the repository at this point in the history
fix(github): commit action
  • Loading branch information
Nelfimov committed Aug 21, 2024
2 parents 0e90c0e + 9a97354 commit cdb2181
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/actions/commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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

0 comments on commit cdb2181

Please sign in to comment.