File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -12,20 +12,21 @@ jobs:
12
12
steps :
13
13
- uses : actions/checkout@v4
14
14
- name : Verify if PR already open
15
+ id : pr-check
15
16
env :
16
17
GH_TOKEN : ${{ secrets.PAT }}
17
18
run : |
18
19
prs_list=$(gh pr list --search "${{ github.ref_name }}")
19
20
echo "${prs_list}"
20
- for pr in $prs_list; do
21
- echo ${pr}
22
- done
23
21
if [ -n "$prs_list" ]; then
24
22
echo "PR already opened"
25
- exit 0
23
+ echo "::set-output name=pr_exists::true"
24
+ else
25
+ echo "::set-output name=pr_exists::false"
26
26
fi
27
27
28
- - name : create pull request
28
+ - name : Create pull request
29
+ if : steps.pr-check.outputs.pr_exists == 'false' # Only run if no PR exists
29
30
run : gh pr create -B main -H ${{ github.ref_name }} --title 'Merge ${{ github.ref_name }} into main' --body 'Created by Github action'
30
31
env :
31
32
GITHUB_TOKEN : ${{ secrets.PAT }}
You can’t perform that action at this time.
0 commit comments