From 317a4c48f058755019475de79896230dadc6474c Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 23 Aug 2023 21:18:53 +0100 Subject: [PATCH 1/2] ci: Move `git config ...` to `run-in-docker-action` --- .github/actions/run-in-docker-action/action.yml | 5 ++++- .github/workflows/ci.yml | 11 ----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/actions/run-in-docker-action/action.yml b/.github/actions/run-in-docker-action/action.yml index 79cf9d6233..30e83ff295 100644 --- a/.github/actions/run-in-docker-action/action.yml +++ b/.github/actions/run-in-docker-action/action.yml @@ -41,5 +41,8 @@ runs: $(echo '${{ toJSON(env) }}' | jq -r 'keys[] | "--env \(.) "') \ --volume ${{ github.workspace }}:${{ github.workspace }} \ --workdir ${{ github.workspace }} \ - ${{ inputs.tag }} bash -c "${{ inputs.command }}" + ${{ inputs.tag }} bash -c " + git config --global --add safe.directory ${{ github.workspace }} + ${{ inputs.command }} + " shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1307b99c7..35b0ca0c88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -156,7 +155,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -203,7 +201,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -258,7 +255,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -305,7 +301,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -352,7 +347,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -409,7 +403,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -467,7 +460,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -526,7 +518,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -583,7 +574,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true @@ -747,7 +737,6 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image command: > - git config --global --add safe.directory ${{ github.workspace }} && ./ci/ci.sh - run: cat tests.log || true From cce045630407e662c90279abb2b0e71161f24e74 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 23 Aug 2023 21:31:57 +0100 Subject: [PATCH 2/2] ci: Make repetitive command the default one --- .../actions/run-in-docker-action/action.yml | 3 ++- .github/workflows/ci.yml | 22 ------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/.github/actions/run-in-docker-action/action.yml b/.github/actions/run-in-docker-action/action.yml index 30e83ff295..d357c3cf75 100644 --- a/.github/actions/run-in-docker-action/action.yml +++ b/.github/actions/run-in-docker-action/action.yml @@ -9,7 +9,8 @@ inputs: required: true command: description: 'A command to run in a container' - required: true + required: false + default: ./ci/ci.sh runs: using: "composite" steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35b0ca0c88..441cf41ee9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,8 +104,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -154,8 +152,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -200,8 +196,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -254,8 +248,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -300,8 +292,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -346,8 +336,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -402,8 +390,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -459,8 +445,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -517,8 +501,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -573,8 +555,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }} @@ -736,8 +716,6 @@ jobs: with: dockerfile: ./ci/linux-debian.Dockerfile tag: linux-debian-image - command: > - ./ci/ci.sh - run: cat tests.log || true if: ${{ always() }}