-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 956 Bytes
/
create-deploy-pr.yml
File metadata and controls
34 lines (29 loc) · 956 Bytes
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
name: Auto Create Deploy PR
on:
push:
branches: ['dev', 'test-auto-deploy']
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get current time
uses: josStorer/get-current-time@v2.0.2
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: '+09:00'
- name: Check existing PR
id: check-pr
run: |
existing_pr=$(gh pr list --base main --head dev --json number --jq length)
echo "pr_exists=$existing_pr" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Create Pull Request
if: steps.check-pr.outputs.pr_exists == '0'
run: |
gh pr create -B main -H dev --title "Deploy: 배포" --body "${{steps.current-time.outputs.readableTime}}에 생성됨"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}