Skip to content

Commit f34187c

Browse files
authored
Revert "feat(action): allow resizing images before upload (#707)"
This reverts commit 57b1b86.
1 parent 57b1b86 commit f34187c

File tree

10 files changed

+128
-7171
lines changed

10 files changed

+128
-7171
lines changed

action.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ inputs:
3535
description: 'The GitHub access token'
3636
required: false
3737
default: ${{ github.token }}
38-
max-image-width:
39-
description: 'Maximum width for uploaded images (in pixels). If not provided, images will not be resized. Recommended: 1500.'
40-
required: false
41-
max-image-height:
42-
description: 'Maximum height for uploaded images (in pixels). If not provided, images will not be resized. Recommended: 1500.'
43-
required: false
4438
runs:
4539
using: 'node20'
4640
main: 'action/dist/main.js'

action/dist/main.js

Lines changed: 117 additions & 6766 deletions
Large diffs are not rendered by default.

action/dist/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"@actions/github": "9.0.0",
88
"@aws-sdk/client-s3": "3.975.0",
99
"bluebird": "3.7.2",
10-
"glob": "13.0.0",
11-
"sharp": "0.34.5"
10+
"glob": "13.0.0"
1211
},
1312
"devDependencies": {
1413
"@types/bluebird": "3.5.42",

action/src/image-utils.ts

Lines changed: 0 additions & 94 deletions
This file was deleted.

action/src/s3-operations.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import * as fs from 'fs';
1717
import { promises as fsPromises } from 'fs';
1818
import { glob } from 'glob';
1919
import { Readable } from 'stream';
20-
import { resizeImages } from './image-utils';
2120

2221
const s3Client = new S3Client();
2322

@@ -96,9 +95,6 @@ async function uploadLocalDirectory(
9695
`Uploading ${files.length} file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
9796
);
9897

99-
const filePaths = files.map(file => path.join(localDir, file));
100-
await resizeImages(filePaths);
101-
10298
await map(files, async file => {
10399
const localFilePath = path.join(localDir, file);
104100
const s3Key = path.join(s3Prefix, file);
@@ -196,7 +192,6 @@ export const uploadAllImages = async (hash: string) => {
196192
export const uploadBaseImages = async (newFilePaths: string[]) => {
197193
const bucketName = getInput('bucket-name', { required: true });
198194
info(`Uploading ${newFilePaths.length} base image(s)`);
199-
await resizeImages(newFilePaths);
200195
return map(newFilePaths, newFilePath =>
201196
uploadSingleFile(newFilePath, bucketName, buildBaseImagePath(newFilePath))
202197
);

action/test/image-utils.test.ts

Lines changed: 0 additions & 201 deletions
This file was deleted.

action/test/run.test.ts

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,14 @@ const getInputMock = mock();
1818
const getBooleanInputMock = mock();
1919
const getMultilineInputMock = mock();
2020
const setFailedMock = mock();
21-
const infoMock = mock();
22-
const warningMock = mock();
23-
24-
// Create a comprehensive mock for @actions/core to handle ES module exports
25-
mock.module('@actions/core', () => {
26-
return {
27-
info: infoMock,
28-
getInput: getInputMock,
29-
getBooleanInput: getBooleanInputMock,
30-
getMultilineInput: getMultilineInputMock,
31-
setFailed: setFailedMock,
32-
warning: warningMock,
33-
// Add other exports that might be imported
34-
debug: mock(),
35-
error: mock(),
36-
setOutput: mock(),
37-
setSecret: mock(),
38-
addPath: mock(),
39-
exportVariable: mock(),
40-
setCommandEcho: mock(),
41-
saveState: mock(),
42-
getState: mock(),
43-
group: mock(),
44-
startGroup: mock(),
45-
endGroup: mock(),
46-
// ES module default export
47-
default: {
48-
info: infoMock,
49-
getInput: getInputMock,
50-
getBooleanInput: getBooleanInputMock,
51-
getMultilineInput: getMultilineInputMock,
52-
setFailed: setFailedMock,
53-
warning: warningMock
54-
}
55-
};
56-
});
21+
mock.module('@actions/core', () => ({
22+
info: mock(),
23+
getInput: getInputMock,
24+
getBooleanInput: getBooleanInputMock,
25+
getMultilineInput: getMultilineInputMock,
26+
setFailed: setFailedMock,
27+
warning: mock()
28+
}));
5729

5830
const execMock = mock();
5931
mock.module('@actions/exec', () => ({

0 commit comments

Comments
 (0)