Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/fixAutoPR #47

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,57 @@
name: Release

"on":
create:
pull_request:
types: [opened, synchronize]
push:
branchs-ignore:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
openPR:
get-changes:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
outputs:
updCont: ${{ steps.updCont.outputs.any_changed }}
dev: ${{ steps.dev.outputs.any_changed }}
existPR: ${{ steps.existPR.outputs.cnt }}
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v45
- name: Check updCont
uses: tj-actions/changed-files@v45
id: updCont
with:
base_sha: 'main'
files: |
content/**
data/**
- uses: tj-actions/changed-files@v45
id: updSrc
- name: Check dev
uses: tj-actions/changed-files@v45
id: dev
with:
base_sha: 'main'
files: |
*
!content/**
!data/**
- name: Check exist PR
id: existPR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "cnt=$(gh pr list -B main -H ${{ github.ref_name }} | wc -l)" \
>> $GITHUB_OUTPUT
createPR:
runs-on: ubuntu-22.04
needs:
- get-changes
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Create PR
if: ${{ github.event_name }} != create
if: needs.get-changes.outputs.existPR == 0
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -42,14 +62,16 @@ jobs:
--body "" \
--draft
- name: Mark as post
if: steps.updCont.outputs.any_changed == true
if: needs.get-changes.outputs.updCont == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit "${{ github.ref_name }}" --add-label "create post"
gh pr edit "${{ github.ref_name }}" \
--add-label "documentation"
- name: Mark as dev
if: steps.updSrc.outputs.any_changed == true
if: needs.get-changes.outputs.dev == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit "${{ github.ref_name }}" --add-label "development"
gh pr edit "${{ github.ref_name }}" \
--add-label "enhancement"
Loading