mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-08-09 08:03:53 +00:00
perf: build base image action
This commit is contained in:
10
.github/workflows/build-base-image.yml
vendored
10
.github/workflows/build-base-image.yml
vendored
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user