Skip to content

🔖 Update to 0.1.0 #12

🔖 Update to 0.1.0

🔖 Update to 0.1.0 #12

name: PR Automation Workflow
on:
pull_request:
branches:
- main
- dev
- release/*
- fix/*
jobs:
check-files:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get all changed files
id: files
uses: jitterbit/get-changed-files@v1
with:
format: "space"
- name: Check for updated files
run: |
CHANGED_FILES="${{ steps.files.outputs.all }}"
if [[ ! "$CHANGED_FILES" =~ "package.json" ]] || [[ ! "$CHANGED_FILES" =~ "CHANGELOG.md" ]]; then
echo "Error: package.json or CHANGELOG.md must be updated."
exit 1
fi
auto-create-pr-to-dev-main:
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'main' && contains(github.head_ref, 'release/')
steps:
- uses: actions/checkout@v2
- name: Auto-create PR to dev for release branches
uses: peter-evans/create-pull-request@v3
with:
branch: sync-${{ github.head_ref }}-to-dev
base: dev
title: "[AUTO] Sync ${{ github.head_ref }} to dev"
body: "Automated PR to sync changes from ${{ github.head_ref }} to dev."
token: ${{ secrets.GITHUB_TOKEN }}
mirror-fix-to-dev:
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'main' && contains(github.head_ref, 'fix/')
steps:
- uses: actions/checkout@v2
- name: Auto-create PR to dev for fix branches
uses: peter-evans/create-pull-request@v3
with:
branch: sync-${{ github.head_ref }}-to-dev
base: dev
title: "[AUTO] Sync ${{ github.head_ref }} to dev"
body: "Automated PR to sync changes from ${{ github.head_ref }} to dev."
token: ${{ secrets.GITHUB_TOKEN }}