@@ -15,16 +15,21 @@ jobs:
1515 uses : ./
1616 id : run-docker
1717 with :
18- image : docker:20.10.3
18+ image : docker:29.0.4
19+ options : -v ${{ github.workspace }}:/github/workspace
1920 run : |
20- echo "::set-output name=docker-version::`echo $DOCKER_VERSION`"
21+ # write into the mounted repo so the runner can read it
22+ echo "$DOCKER_VERSION" > /github/workspace/docker_version
23+ - run : cat docker_version
2124 - name : Test the output
2225 uses : actions/github-script@v3
2326 with :
2427 script : |
25- const dockerVersion = '${{ steps.run-docker.outputs.docker-version }}';
26- if (dockerVersion !== '20.10.3') {
27- core.setFailed(`Smoke Test Failed`);
28+ const fs = require('fs');
29+ const dockerVersion = fs.readFileSync('docker_version', 'utf8').trim();
30+ const expected = '29.0.4';
31+ if (dockerVersion !== expected) {
32+ core.setFailed(`Smoke Test Failed: expected ${expected} but received ${dockerVersion}`);
2833 }
2934 volume-mount-test :
3035 runs-on : ubuntu-latest
@@ -39,12 +44,13 @@ jobs:
3944 image : docker
4045 options : -v ${{ github.workspace }}:/work
4146 run : |
42- echo "::set-output name=file-contents::`cat /work/someFile`"
47+ cp /work/someFile /work/secondFile
4348 - name : Check if file contents match
4449 uses : actions/github-script@v8
4550 with :
4651 script : |
47- const fileContents = '${{ steps.run-docker.outputs.file-contents }}';
52+ const fs = require('fs');
53+ const fileContents = fs.readFileSync('secondFile', 'utf8').trim();
4854 if (fileContents !== 'some text') {
4955 core.setFailed(`Unable to mount workspace volume`);
5056 }
0 commit comments