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

Possibility to individualize unpacking (Azure Devops) #186

Open
1 task done
Ayax0 opened this issue Oct 14, 2024 · 0 comments
Open
1 task done

Possibility to individualize unpacking (Azure Devops) #186

Ayax0 opened this issue Oct 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Ayax0
Copy link

Ayax0 commented Oct 14, 2024

Describe the feature

I have tried to implement a custom provider for Azure Devops. My code looks like this:

const devops: TemplateProvider = async (input, { auth }) => {
	const match =
		input.match(
			/^(?<org>[\w.-]+)\/(?<proj>[\w. ]+)\/(?<repo>[\w.]+)(?<subdir>[^#]+)?(?<ref>#[\w./@-]+)?/,
		)?.groups || {};

	return {
		name: "devops",
		version: input,
		headers: { authorization: Buffer.from(`:${auth}`).toString("base64") },
		url: `https://dev.azure.com/${match.org}/${match.proj}/_git/${match.repo}?path=${match.subdir || "/"}&version=GB${match.ref ? match.ref.slice(1) : "main"}`,
		tar: `https://dev.azure.com/${match.org}/${match.proj}/_apis/git/repositories/${match.repo}/items/items?path=${match.subdir || "/"}&versionDescriptor[version]=${match.ref ? match.ref.slice(1) : "main"}&resolveLfs=true&$format=zip&download=true`,
	};
};

The problem is that Devops only allows a download as a zip file. So the download fails because a tar.gz file is expected.

It would be good if, for example, a separate unpacking callback function could be provided by the provider so that an alternative unpacking function can be used in this case.

Additional information

  • Would you be willing to help implement this feature?
@Ayax0 Ayax0 added the enhancement New feature or request label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant