Skip to content

Commit

Permalink
feat: combine jobs and fix condition for labelling
Browse files Browse the repository at this point in the history
  • Loading branch information
atsuyaw committed Oct 23, 2024
1 parent 6c7f54e commit cefdeff
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ concurrency:
jobs:
get-changes:
runs-on: ubuntu-22.04
outputs:
updCont: ${{ steps.updCont.outputs.any_changed }}
dev: ${{ steps.dev.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
- name: Check updCont
Expand All @@ -34,12 +31,6 @@ jobs:
files: |
!content/**
!data/**
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: |
Expand All @@ -49,16 +40,10 @@ jobs:
--head "${{ github.ref_name }}" \
--state "open" \
| wc -l)" >> $GITHUB_OUTPUT
createPR:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
needs:
- check-existPR
if: needs.existPR.outputs.cnt != 0
steps:
- uses: actions/checkout@v4
- name: Create PR
if: steps.PRexist.outputs.cnt == 0
permissions:
pull-requests: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -68,24 +53,17 @@ jobs:
--title "${{ github.ref_name }}" \
--body "" \
--draft
labelPR:
runs-on: ubuntu-22.04
needs:
- get-changes
- createPR
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Mark as post
if: needs.get-changes.outputs.updCont == 'true'
if: steps.updCont.outputs.any_changed == 'true'
permissions:
pull-requests: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit "${{ github.ref_name }}" \
--add-label "create post"
- name: Mark as dev
if: needs.get-changes.outputs.dev == 'true'
if: steps.dev.outputs.any_changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down

0 comments on commit cefdeff

Please sign in to comment.