@@ -24957,13 +24957,17 @@ module.exports = {
24957
24957
const tests = {};
24958
24958
exports.tests = tests;
24959
24959
24960
- exports.aws = ({ region = "US", access_key = "", secret_key = "" }) => ({
24960
+ // each provider function should return an object of keys that should be
24961
+ // set in the final s3cmd config file. Any key can be set. not just the
24962
+ // ones that are commonly used below.
24963
+ // for each provider, one or more tests should be defined in the tests
24964
+ // object.
24965
+
24966
+ exports.aws = ({ region = "US" }) => ({
24961
24967
bucket_location: region,
24962
24968
host_base: "s3.amazonaws.com",
24963
24969
host_bucket: "%(bucket)s.s3.amazonaws.com",
24964
24970
website_endpoint: "http://%(bucket)s.s3-website-%(location)s.amazonaws.com/",
24965
- access_key,
24966
- secret_key,
24967
24971
});
24968
24972
24969
24973
tests.aws = {
@@ -24978,17 +24982,11 @@ tests.aws = {
24978
24982
],
24979
24983
};
24980
24984
24981
- exports.digitalocean = ({
24982
- region = "nyc3",
24983
- access_key = "",
24984
- secret_key = "",
24985
- }) => ({
24985
+ exports.digitalocean = ({ region = "nyc3" }) => ({
24986
24986
bucket_location: region,
24987
24987
host_base: `${region}.digitaloceanspaces.com`,
24988
24988
host_bucket: `%(bucket)s.${region}.digitaloceanspaces.com`,
24989
24989
website_endpoint: `http://%(bucket)s.website-${region}.digitaloceanspaces.com`,
24990
- access_key,
24991
- secret_key,
24992
24990
});
24993
24991
24994
24992
tests.digitalocean = {
@@ -25003,17 +25001,11 @@ tests.digitalocean = {
25003
25001
],
25004
25002
};
25005
25003
25006
- exports.linode = ({
25007
- region = "eu-central-1",
25008
- access_key = "",
25009
- secret_key = "",
25010
- }) => ({
25004
+ exports.linode = ({ region = "eu-central-1" }) => ({
25011
25005
bucket_location: "US",
25012
25006
host_base: `${region}.linodeobjects.com`,
25013
25007
host_bucket: `%(bucket)s.${region}.linodeobjects.com`,
25014
25008
website_endpoint: `http://%(bucket)s.website-${region}.linodeobjects.com/`,
25015
- access_key,
25016
- secret_key,
25017
25009
});
25018
25010
25019
25011
tests.linode = {
@@ -25028,17 +25020,11 @@ tests.linode = {
25028
25020
],
25029
25021
};
25030
25022
25031
- exports.scaleway = ({
25032
- region = "fr-par",
25033
- access_key = "",
25034
- secret_key = "",
25035
- }) => ({
25023
+ exports.scaleway = ({ region = "fr-par" }) => ({
25036
25024
bucket_location: region,
25037
25025
host_base: `s3.${region}.scw.cloud`,
25038
25026
host_bucket: `%(bucket)s.s3.${region}.scw.cloud`,
25039
25027
website_endpoint: `https://%(bucket)s.s3-website.${region}.scw.cloud/`,
25040
- access_key,
25041
- secret_key,
25042
25028
});
25043
25029
25044
25030
tests.scaleway = {
@@ -25053,18 +25039,11 @@ tests.scaleway = {
25053
25039
],
25054
25040
};
25055
25041
25056
- exports.cloudflare = ({
25057
- account_id = "",
25058
- region = "auto",
25059
- access_key = "",
25060
- secret_key = "",
25061
- }) => ({
25042
+ exports.cloudflare = ({ account_id = "", region = "auto" }) => ({
25062
25043
bucket_location: region,
25063
25044
host_base: `${account_id}.r2.cloudflarestorage.com`,
25064
25045
host_bucket: "",
25065
25046
website_endpoint: "",
25066
- access_key,
25067
- secret_key,
25068
25047
});
25069
25048
25070
25049
tests.cloudflare = {
@@ -25080,13 +25059,11 @@ tests.cloudflare = {
25080
25059
],
25081
25060
};
25082
25061
25083
- exports.vultr = ({ region = "ewr1", access_key = "", secret_key = "" }) => ({
25062
+ exports.vultr = ({ region = "ewr1" }) => ({
25084
25063
bucket_location: region,
25085
25064
host_base: `${region}.vultrobjects.com`,
25086
25065
host_bucket: `%(bucket)s.${region}.vultrobjects.com`,
25087
25066
website_endpoint: "",
25088
- access_key,
25089
- secret_key,
25090
25067
});
25091
25068
25092
25069
tests.vultr = {
@@ -25100,17 +25077,11 @@ tests.vultr = {
25100
25077
],
25101
25078
};
25102
25079
25103
- exports.clevercloud = ({
25104
- region = "US",
25105
- access_key = "",
25106
- secret_key = "",
25107
- }) => ({
25080
+ exports.clevercloud = ({ region = "US" }) => ({
25108
25081
bucket_location: region,
25109
25082
host_base: `cellar-c2.services.clever-cloud.com`,
25110
25083
host_bucket: `%(bucket)s.cellar-c2.services.clever-cloud.com`,
25111
25084
website_endpoint: "",
25112
- access_key,
25113
- secret_key,
25114
25085
});
25115
25086
25116
25087
tests.clevercloud = {
@@ -25125,13 +25096,11 @@ tests.clevercloud = {
25125
25096
],
25126
25097
};
25127
25098
25128
- exports.hcloud = ({ region = "fsn1", access_key = "", secret_key = "" }) => ({
25099
+ exports.hcloud = ({ region = "fsn1" }) => ({
25129
25100
bucket_location: region,
25130
25101
host_base: `fsn1.your-objectstorage.com`,
25131
25102
host_bucket: `%(bucket)s.fsn1.your-objectstorage.com`,
25132
25103
website_endpoint: "",
25133
- access_key,
25134
- secret_key,
25135
25104
});
25136
25105
25137
25106
tests.hcloud = {
@@ -25145,17 +25114,11 @@ tests.hcloud = {
25145
25114
],
25146
25115
};
25147
25116
25148
- exports.synologyc2 = ({
25149
- region = "us-001",
25150
- access_key = "",
25151
- secret_key = "",
25152
- }) => ({
25117
+ exports.synologyc2 = ({ region = "us-001" }) => ({
25153
25118
bucket_location: region,
25154
25119
host_base: `${region}.s3.synologyc2.net`,
25155
25120
host_bucket: ``,
25156
25121
website_endpoint: "",
25157
- access_key,
25158
- secret_key,
25159
25122
});
25160
25123
25161
25124
tests.synologyc2 = {
@@ -25168,17 +25131,11 @@ tests.synologyc2 = {
25168
25131
],
25169
25132
};
25170
25133
25171
- exports.wasabi = ({
25172
- region = "ap-southeast-1",
25173
- access_key = "",
25174
- secret_key = "",
25175
- }) => ({
25134
+ exports.wasabi = ({ region = "ap-southeast-1" }) => ({
25176
25135
bucket_location: region,
25177
25136
host_base: `s3.${region}.wasabisys.com`,
25178
25137
host_bucket: `%(bucket)s.s3.${region}.wasabisys.com`,
25179
25138
website_endpoint: "",
25180
- access_key,
25181
- secret_key,
25182
25139
});
25183
25140
25184
25141
tests.wasabi = {
@@ -25192,17 +25149,11 @@ tests.wasabi = {
25192
25149
],
25193
25150
};
25194
25151
25195
- exports.yandex = ({
25196
- region = "ru-central1",
25197
- access_key = "",
25198
- secret_key = "",
25199
- }) => ({
25152
+ exports.yandex = ({ region = "ru-central1" }) => ({
25200
25153
bucket_location: region,
25201
25154
host_base: `storage.yandexcloud.net`,
25202
25155
host_bucket: `%(bucket)s.storage.yandexcloud.net`,
25203
25156
website_endpoint: "",
25204
- access_key,
25205
- secret_key,
25206
25157
});
25207
25158
25208
25159
tests.yandex = {
@@ -27192,12 +27143,18 @@ if (process.env.RUNNER_TEMP) {
27192
27143
core.debug(`S3CMD_CONFIG=${process.env.S3CMD_CONFIG}`);
27193
27144
}
27194
27145
27146
+ // expose the access and secret key as github action variables.
27147
+ // registering them as secret, just to be sure. normally they should be
27148
+ // be registered already. registering leads to masking in logs
27149
+ core.setSecret(core.getInput("access_key"));
27150
+ core.setSecret(core.getInput("secret_key"));
27151
+ core.exportVariable("AWS_ACCESS_KEY", core.getInput("access_key"));
27152
+ core.exportVariable("AWS_SECRET_KEY", core.getInput("secret_key"));
27153
+
27195
27154
configure(
27196
27155
providers[core.getInput("provider")]({
27197
27156
region: core.getInput("region"),
27198
27157
account_id: core.getInput("account_id"),
27199
- access_key: core.getInput("access_key"),
27200
- secret_key: core.getInput("secret_key"),
27201
27158
}),
27202
27159
);
27203
27160
0 commit comments