Skip to content

Commit ea26b71

Browse files
Merge #1411: ci: Make repetitive command the default one
cce0456 ci: Make repetitive command the default one (Hennadii Stepanov) 317a4c4 ci: Move `git config ...` to `run-in-docker-action` (Hennadii Stepanov) Pull request description: This PR addresses the #1409 (comment): > couldn't we add this to `run-in-docker-action` to avoid duplication? ACKs for top commit: real-or-random: ACK cce0456 Tree-SHA512: 793cec3d99853a23e06680fe35a7cae2dc8771f22e3940c4a4f36357273164f2d92e196768118d146e956ffca9ef59d4e5f86e1cba5576ebfdc59343581c9924
2 parents 4d7fe60 + cce0456 commit ea26b71

File tree

2 files changed

+6
-35
lines changed

2 files changed

+6
-35
lines changed

.github/actions/run-in-docker-action/action.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ inputs:
99
required: true
1010
command:
1111
description: 'A command to run in a container'
12-
required: true
12+
required: false
13+
default: ./ci/ci.sh
1314
runs:
1415
using: "composite"
1516
steps:
@@ -41,5 +42,8 @@ runs:
4142
$(echo '${{ toJSON(env) }}' | jq -r 'keys[] | "--env \(.) "') \
4243
--volume ${{ github.workspace }}:${{ github.workspace }} \
4344
--workdir ${{ github.workspace }} \
44-
${{ inputs.tag }} bash -c "${{ inputs.command }}"
45+
${{ inputs.tag }} bash -c "
46+
git config --global --add safe.directory ${{ github.workspace }}
47+
${{ inputs.command }}
48+
"
4549
shell: bash

.github/workflows/ci.yml

-33
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ jobs:
104104
with:
105105
dockerfile: ./ci/linux-debian.Dockerfile
106106
tag: linux-debian-image
107-
command: >
108-
git config --global --add safe.directory ${{ github.workspace }} &&
109-
./ci/ci.sh
110107

111108
- run: cat tests.log || true
112109
if: ${{ always() }}
@@ -155,9 +152,6 @@ jobs:
155152
with:
156153
dockerfile: ./ci/linux-debian.Dockerfile
157154
tag: linux-debian-image
158-
command: >
159-
git config --global --add safe.directory ${{ github.workspace }} &&
160-
./ci/ci.sh
161155

162156
- run: cat tests.log || true
163157
if: ${{ always() }}
@@ -202,9 +196,6 @@ jobs:
202196
with:
203197
dockerfile: ./ci/linux-debian.Dockerfile
204198
tag: linux-debian-image
205-
command: >
206-
git config --global --add safe.directory ${{ github.workspace }} &&
207-
./ci/ci.sh
208199

209200
- run: cat tests.log || true
210201
if: ${{ always() }}
@@ -257,9 +248,6 @@ jobs:
257248
with:
258249
dockerfile: ./ci/linux-debian.Dockerfile
259250
tag: linux-debian-image
260-
command: >
261-
git config --global --add safe.directory ${{ github.workspace }} &&
262-
./ci/ci.sh
263251

264252
- run: cat tests.log || true
265253
if: ${{ always() }}
@@ -304,9 +292,6 @@ jobs:
304292
with:
305293
dockerfile: ./ci/linux-debian.Dockerfile
306294
tag: linux-debian-image
307-
command: >
308-
git config --global --add safe.directory ${{ github.workspace }} &&
309-
./ci/ci.sh
310295

311296
- run: cat tests.log || true
312297
if: ${{ always() }}
@@ -351,9 +336,6 @@ jobs:
351336
with:
352337
dockerfile: ./ci/linux-debian.Dockerfile
353338
tag: linux-debian-image
354-
command: >
355-
git config --global --add safe.directory ${{ github.workspace }} &&
356-
./ci/ci.sh
357339

358340
- run: cat tests.log || true
359341
if: ${{ always() }}
@@ -408,9 +390,6 @@ jobs:
408390
with:
409391
dockerfile: ./ci/linux-debian.Dockerfile
410392
tag: linux-debian-image
411-
command: >
412-
git config --global --add safe.directory ${{ github.workspace }} &&
413-
./ci/ci.sh
414393

415394
- run: cat tests.log || true
416395
if: ${{ always() }}
@@ -466,9 +445,6 @@ jobs:
466445
with:
467446
dockerfile: ./ci/linux-debian.Dockerfile
468447
tag: linux-debian-image
469-
command: >
470-
git config --global --add safe.directory ${{ github.workspace }} &&
471-
./ci/ci.sh
472448

473449
- run: cat tests.log || true
474450
if: ${{ always() }}
@@ -525,9 +501,6 @@ jobs:
525501
with:
526502
dockerfile: ./ci/linux-debian.Dockerfile
527503
tag: linux-debian-image
528-
command: >
529-
git config --global --add safe.directory ${{ github.workspace }} &&
530-
./ci/ci.sh
531504

532505
- run: cat tests.log || true
533506
if: ${{ always() }}
@@ -582,9 +555,6 @@ jobs:
582555
with:
583556
dockerfile: ./ci/linux-debian.Dockerfile
584557
tag: linux-debian-image
585-
command: >
586-
git config --global --add safe.directory ${{ github.workspace }} &&
587-
./ci/ci.sh
588558

589559
- run: cat tests.log || true
590560
if: ${{ always() }}
@@ -746,9 +716,6 @@ jobs:
746716
with:
747717
dockerfile: ./ci/linux-debian.Dockerfile
748718
tag: linux-debian-image
749-
command: >
750-
git config --global --add safe.directory ${{ github.workspace }} &&
751-
./ci/ci.sh
752719

753720
- run: cat tests.log || true
754721
if: ${{ always() }}

0 commit comments

Comments
 (0)