Skip to content

Commit ae918d7

Browse files
committedApr 18, 2023
Create a github actions for creating git branch
1 parent 886a42c commit ae918d7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
 
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on: push
2+
jobs:
3+
build:
4+
runs-on: ubuntu-latest
5+
steps:
6+
- uses: actions/checkout@v3
7+
- id: get_date
8+
name: Get date
9+
run: |
10+
current_date=$(date -u "+%Y%m%d%H%M%S")
11+
echo "current_date=$current_date" >> $GITHUB_OUTPUT
12+
13+
- name: Create git branch
14+
run: |
15+
echo ${{steps.get_date.outputs.current_date}} > auto-generated-${{steps.get_date.outputs.current_date}}.txt
16+
git config user.name "GitHub Action"
17+
git config user.email "action@github.com"
18+
git config --add push.default current
19+
git config --add push.autoSetupRemote true
20+
21+
git checkout -b our-github-actions/${{steps.get_date.outputs.current_date}}
22+
git add .
23+
git commit -m "auto commit at ${{steps.get_date.outputs.current_date}}"
24+
git push

0 commit comments

Comments
 (0)
Please sign in to comment.