-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaction.yml
51 lines (48 loc) · 1.38 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: "bumpgen"
description: "handle breaking changes from dependency upgrades"
author: Xeol <xeol.io>
inputs:
path:
description: Repository path
required: false
default: "./"
llm_key:
description: "LLM API key"
required: true
github_token:
description: "GitHub token"
required: true
runs:
using: "composite"
steps:
- shell: bash
env:
LLM_API_KEY: ${{ inputs.llm_key }}
run: |
npm install -g bumpgen
bumpgen --simple --dir ${{ inputs.path }} --no-upgrade --auto-detect
- shell: bash
name: Configure Git
run: |
git config user.name "github-actions[bot]"
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: ${{ inputs.github_token }}
run: |
git add -u
if ! git diff-index --quiet HEAD; then
git commit -m "chore: run bumpgen"
echo "::set-output name=changes_detected::true"
else
echo "No changes to commit"
echo "::set-output name=changes_detected::false"
fi
- 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 }}