Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Disable setting of Cargo git source branches #125

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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