-
Notifications
You must be signed in to change notification settings - Fork 79
/
action.yml
29 lines (28 loc) · 885 Bytes
/
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
name: "Action to commit changes to the repository"
outputs:
sha:
description: "SHA of generated commit"
value: ${{ steps.commit.outputs.sha }}
runs:
using: "composite"
steps:
- name: Commit if changed
id: commit
run: |
set -x
if [ -n "$(git status --porcelain)" ]; then
echo "Changed"
git fetch
if [ -n "${GITHUB_HEAD_REF}" ]; then
git add .
git stash save
git switch ${GITHUB_HEAD_REF}
git merge origin/${GITHUB_BASE_REF} --no-edit
git stash pop
fi
git add .
git commit -m "Auto-update from GitHub Actions"$'\n'$'\n'"Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
git push -u origin HEAD
echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT
fi
shell: bash