Skip to content

Commit

Permalink
feat: Create PR only if there've been PR for its' branch yet
Browse files Browse the repository at this point in the history
  • Loading branch information
atsuyaw committed Oct 23, 2024
1 parent 0f8bf7b commit f0ba1a8
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
files: |
content/**
data/**
- name: Output updCont
run: |
echo ${{ steps.updCont.outputs.any_changed }}
- name: Check dev
uses: tj-actions/changed-files@v45
id: dev
Expand All @@ -38,14 +35,29 @@ jobs:
files: |
!content/**
!data/**
- name: Output dev
check-existPR:
runs-on: ubuntu-22.04
outputs:
PRexist: ${{ steps.PRexist.outputs.cnt }}
steps:
- uses: actions/checkout@v4
- name: Check exist PR
id: PRexist
run: |
echo ${{ steps.dev.outputs.any_changed }}
echo "cnt= \
$(gh pr list --search \
--base "main" \
--head "${{ github.ref_name }}" \
--state "open" \
| wc -l)" >> $GITHUB_OUTPUT
createPR:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
if: ${{ github.event_name }} == 'create'
needs:
- check-existPR
if: needs.existPR.outputs.cnt != 0

Check failure on line 60 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / yamllint

60:5 [key-duplicates] duplication of key "if" in mapping
steps:
- uses: actions/checkout@v4
- name: Create PR
Expand Down

0 comments on commit f0ba1a8

Please sign in to comment.