Skip to content

Commit

Permalink
fix: Disable setting of Cargo git source branches (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz authored Apr 30, 2024
1 parent 882641d commit 6b2a870
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 36 deletions.
15 changes: 11 additions & 4 deletions dist/build-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127365,7 +127365,8 @@ async function bump(path, version) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
async function bumpDependencies(path, pattern, version, branch) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function bumpDependencies(path, pattern, version, _branch) {
core.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -127382,9 +127383,15 @@ async function bumpDependencies(path, pattern, version, branch) {
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}
// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}
for (const package_ of packages(path)) {
Expand Down
15 changes: 11 additions & 4 deletions dist/build-crates-standalone-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127350,7 +127350,8 @@ async function bump(path, version) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
async function bumpDependencies(path, pattern, version, branch) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function bumpDependencies(path, pattern, version, _branch) {
core.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -127367,9 +127368,15 @@ async function bumpDependencies(path, pattern, version, branch) {
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}
// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}
for (const package_ of packages(path)) {
Expand Down
15 changes: 11 additions & 4 deletions dist/bump-crates-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -81071,7 +81071,8 @@ async function bump(path, version) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
async function bumpDependencies(path, pattern, version, branch) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function bumpDependencies(path, pattern, version, _branch) {
_actions_core__WEBPACK_IMPORTED_MODULE_2__.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -81088,9 +81089,15 @@ async function bumpDependencies(path, pattern, version, branch) {
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}
// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}
for (const package_ of packages(path)) {
Expand Down
15 changes: 11 additions & 4 deletions dist/publish-crates-cargo-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -80959,7 +80959,8 @@ async function bump(path, version) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
async function bumpDependencies(path, pattern, version, branch) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function bumpDependencies(path, pattern, version, _branch) {
core.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -80976,9 +80977,15 @@ async function bumpDependencies(path, pattern, version, branch) {
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}
// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}
for (const package_ of packages(path)) {
Expand Down
15 changes: 11 additions & 4 deletions dist/publish-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127345,7 +127345,8 @@ async function bump(path, version) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
async function bumpDependencies(path, pattern, version, branch) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function bumpDependencies(path, pattern, version, _branch) {
core.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -127362,9 +127363,15 @@ async function bumpDependencies(path, pattern, version, branch) {
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}
// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}
for (const package_ of packages(path)) {
Expand Down
15 changes: 11 additions & 4 deletions dist/publish-crates-eclipse-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127426,7 +127426,8 @@ async function bump(path, version) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
async function bumpDependencies(path, pattern, version, branch) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function bumpDependencies(path, pattern, version, _branch) {
core.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -127443,9 +127444,15 @@ async function bumpDependencies(path, pattern, version, branch) {
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}
// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}
for (const package_ of packages(path)) {
Expand Down
15 changes: 11 additions & 4 deletions dist/publish-crates-github-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127426,7 +127426,8 @@ async function bump(path, version) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
async function bumpDependencies(path, pattern, version, branch) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function bumpDependencies(path, pattern, version, _branch) {
core.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -127443,9 +127444,15 @@ async function bumpDependencies(path, pattern, version, branch) {
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}
// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}
for (const package_ of packages(path)) {
Expand Down
15 changes: 11 additions & 4 deletions dist/publish-crates-homebrew-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127330,7 +127330,8 @@ async function bump(path, version) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
async function bumpDependencies(path, pattern, version, branch) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function bumpDependencies(path, pattern, version, _branch) {
core.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -127347,9 +127348,15 @@ async function bumpDependencies(path, pattern, version, branch) {
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}
// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}
for (const package_ of packages(path)) {
Expand Down
16 changes: 12 additions & 4 deletions src/cargo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ export async function bump(path: string, version: string) {
* @param git Git repository location.
* @param branch Branch of git repository location. bumped to @param version.
*/
export async function bumpDependencies(path: string, pattern: RegExp, version: string, branch?: string) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function bumpDependencies(path: string, pattern: RegExp, version: string, _branch?: string) {
core.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`);
const manifestPath = `${path}/Cargo.toml`;
const manifestRaw = toml.get(manifestPath);
Expand All @@ -182,9 +183,16 @@ export async function bumpDependencies(path: string, pattern: RegExp, version: s
for (const dep in manifest.dependencies) {
if (pattern.test(dep)) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version);
if (branch != undefined) {
await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
}

// FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies,
// but as all dependencies are assumed to be on crates.io anyway, this is not necessary.
// Still, the API of all related actions/workflows should be updated to reflect this.
//
// if (branch != undefined) {
// await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch);
// }
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git"));
await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch"));
}
}

Expand Down

0 comments on commit 6b2a870

Please sign in to comment.