perf: change git workflow

pull/14157/head
ibuler 2 months ago committed by Bryan
parent d8af2274f4
commit 8b0073333b

@ -6,22 +6,29 @@ on:
- 'pr*' - 'pr*'
jobs: jobs:
build-and-push: check_change:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.set_skip_flag.outputs.should_skip }} # 输出 should_skip 标志
steps: steps:
- name: Checkout repository - name: Check conditions
uses: actions/checkout@v4 id: set_skip_flag
- name: Check for changes
run: | run: |
if git diff --name-only HEAD^ dev | grep -E 'poetry.lock|pyproject.toml|Dockerfile-base|package.json|go.mod|yarn.lock|pom.xml|install_deps.sh'; then if git diff --name-only dev | grep -E 'poetry.lock|pyproject.toml|Dockerfile-base|package.json|go.mod|yarn.lock|pom.xml|install_deps.sh';then
echo "Changes detected, proceeding with the job." echo "Found deps file changes"
else else
echo "No relevant changes detected, exiting." echo "Not found deps file changes, skip build"
exit 0 echo "::set-output name=should_skip::true" # 根据条件设置输出
fi fi
build-and-push:
runs-on: ubuntu-latest
needs: check_skip # 依赖 check_skip job 的执行结果
if: needs.check_skip.outputs.should_skip != 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3

Loading…
Cancel
Save