File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 24
24
BRANCH_NAME=automated-build-$(date +'%Y%m%d%H%M%S')
25
25
git checkout -b $BRANCH_NAME
26
26
git add dist/index.js
27
- git commit -m "Automated build"
27
+ git diff --quiet && git diff --staged --quiet || git commit -m "Automated build"
28
28
git push origin $BRANCH_NAME
29
29
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
30
30
Original file line number Diff line number Diff line change
1
+ name : test2
2
+
3
+ on : [push]
4
+
5
+
6
+ jobs :
7
+ build :
8
+ runs-on : ubuntu-latest
9
+
10
+ steps :
11
+ - uses : actions/checkout@v2
12
+
13
+ - name : Install dependencies
14
+ run : npm ci
15
+
16
+ - name : Build with ncc
17
+ run : npx @vercel/ncc build index.js -o dist
18
+
19
+ - name : Create new branch and commit changes
20
+ id : create_branch
21
+ run : |
22
+ git config --global user.email "actions@github.com"
23
+ git config --global user.name "GitHub Action"
24
+ BRANCH_NAME=automated-build-$(date +'%Y%m%d%H%M%S')
25
+ git checkout -b $BRANCH_NAME
26
+ git add dist/index.js
27
+ git diff --quiet && git diff --staged --quiet || git commit -m "Automated build"
28
+ git push origin $BRANCH_NAME
29
+ echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
30
+ - name : Create Pull Request
31
+ uses : peter-evans/create-pull-request@v6
32
+ with :
33
+ title : Automated build
34
+ body : This is an automated build.
35
+ branch : ${{ env.BRANCH_NAME }}
36
+ base : master
You can’t perform that action at this time.
0 commit comments