Skip to content

Commit

Permalink
use push action
Browse files Browse the repository at this point in the history
  • Loading branch information
zlalvani committed May 15, 2024
1 parent 9bdb6a1 commit aeefc9a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bumpgen-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ jobs:
with:
path: "./packages/bumpgen-core/"
llm_key: ${{ secrets.LLM_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
17 changes: 14 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
llm_key:
description: "LLM API key"
required: true
github_token:
description: "GitHub token"
required: true

runs:
using: "composite"
Expand All @@ -27,13 +30,21 @@ runs:
git config user.email "github-actions[bot]@users.noreply.github.com"
- shell: bash
name: Check for changes and commit
id: commit_changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
git add -u
if ! git diff-index --quiet HEAD; then
git commit -m "chore: run bumpgen"
git push origin HEAD:${GITHUB_REF#refs/heads/}
echo "::set-output name=changes_detected::true"
else
echo "No changes to commit"
fi
echo "::set-output name=changes_detected::false"
- name: Push changes
if: steps.commit_changes.outputs.changes_detected == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ inputs.github_token }}
branch: ${{ github.ref }}

0 comments on commit aeefc9a

Please sign in to comment.