perf: build base image action

This commit is contained in:
ibuler
2026-08-04 11:51:52 +08:00
committed by 老广
parent 9a0a7077f5
commit 341da28f3f

View File

@@ -91,6 +91,10 @@ jobs:
sed -i 's|-base:.* AS stage-build|-base:${{ env.IMAGE_TAG }} AS stage-build|' Dockerfile
- name: Commit changes
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
INPUT_BRANCH: ${{ inputs.branch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit."
@@ -101,13 +105,11 @@ jobs:
git add Dockerfile
git commit -m "perf: Update Dockerfile with new base image tag"
if [ "${{ github.event_name }}" = "pull_request" ]; then
git push origin HEAD:${{ github.event.pull_request.head.ref }}
git push origin HEAD:"$HEAD_REF"
else
git push origin HEAD:${{ inputs.branch }}
git push origin HEAD:"$INPUT_BRANCH"
fi
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Skip push for fork PR
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}