File tree Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,20 @@ inputs:
24
24
runs :
25
25
using : " composite"
26
26
steps :
27
+ - name : 🚦 Check for changes before committing
28
+ id : check_changes
29
+ shell : bash
30
+ run : |
31
+ if [[ -z "$(git status --porcelain)" ]]; then
32
+ echo "No changes to commit. Skipping auto-commit step."
33
+ echo "changes_detected=false" >> $GITHUB_ENV
34
+ else
35
+ echo "Changes detected. Proceeding with creating a new branch and commit changes."
36
+ echo "changes_detected=true" >> $GITHUB_ENV
37
+ fi
38
+
27
39
- name : 🏗️ Create new branch and commit changes
40
+ if : env.changes_detected == 'true'
28
41
shell : bash
29
42
env :
30
43
GH_TOKEN : ${{ inputs.gh-token }}
44
57
git push --force origin "$NEW_PR_BRANCH"
45
58
46
59
- name : 🪗 Create Pull Request
60
+ if : env.changes_detected == 'true'
47
61
shell : bash
48
62
env :
49
63
GH_TOKEN : ${{ inputs.gh-token }}
62
76
private-key : ${{ inputs.auto-merge-private-key }}
63
77
64
78
- name : 🤖 Squash the PR
79
+ if : env.changes_detected == 'true'
65
80
shell : bash
66
81
run : gh pr merge --squash "$NEW_PR_BRANCH"
67
82
env :
Original file line number Diff line number Diff line change @@ -21,14 +21,14 @@ jobs:
21
21
id : check_pr
22
22
run : |
23
23
echo "PR title: ${{ github.event.pull_request.title }}"
24
- if [[ "${{ github.event.pull_request.title }}" =~ "bump stylelint from" ]]; then
24
+ if [[ "${{ github.event.pull_request.title }}" =~ "bump stylelint from" ]] || [[ "${{ github.event.pull_request.title }}" =~ "bump the stylelint group with" ]] ; then
25
25
echo "Stylelint update detected."
26
26
echo "stylelint_update=true" >> $GITHUB_ENV
27
- elif [[ "${{ github.event.pull_request.title }}" =~ "bump prettier from" ]]; then
27
+ elif [[ "${{ github.event.pull_request.title }}" =~ "bump prettier from" ]] || [[ "${{ github.event.pull_request.title }}" =~ "bump the prettier group with" ]] ; then
28
28
echo "Prettier update detected."
29
29
echo "prettier_update=true" >> $GITHUB_ENV
30
30
else
31
- echo "No Stylelint or prettier updates detected."
31
+ echo "No Stylelint or Prettier updates detected."
32
32
fi
33
33
34
34
- name : 🆙 Set up Node.js
53
53
run : |
54
54
npm run codestyle
55
55
56
- - name : 🚦 Check for changes before committing
57
- id : check_changes
58
- run : |
59
- if [[ -z "$(git status --porcelain)" ]]; then
60
- echo "No changes to commit. Skipping auto-commit step."
61
- echo "changes_detected=false" >> $GITHUB_ENV
62
- else
63
- echo "Changes detected. Proceeding to auto-commit step."
64
- echo "changes_detected=true" >> $GITHUB_ENV
65
-
66
56
- name : 🚘 Auto commit
67
- if : steps.check_changes.outputs.changes_detected == 'true' && ( env.stylelint_update == 'true' || env.prettier_update == 'true')
57
+ if : env.stylelint_update == 'true' || env.prettier_update == 'true'
68
58
uses : ./.github/actions/auto-commit
69
59
with :
70
60
branch-name : " ${{ github.head_ref }}-auto"
You can’t perform that action at this time.
0 commit comments