Force init in Gitea when repo is created - gitea

When you create a repo in Gitea from the website you can mark "Initialize Repository (Adds .gitignore, License and README)", and when you create a repo in Gitea from the API you can set auto_init to true.
Is there any way to configure Gitea to force Initialize Repository for all repos no matter if they are created from the website or API and no matter what the user chose for this option?
In other words, I need to configure my Gitea to always initialize every repo that is created.

Related

Execute git pull on databricks notebook using CLI and/or API

Using Databricks Repos, you can add a git repo to Databricks and execute git actions such as git pull. This is done by clicking on the branch name in the top left, and clicking the button saying "Pull".
I would like to do this without clicking on things in my browser.
What is the Databricks CLI syntax for triggering a git pull on a given repo?
What is the Databricks API endpoint for triggering a git pull on a given repo?
I would assume that both are possible (this answer implies so), but providing just one would be sufficient to answer my question.
One might wonder what I expect to happen if a pull is non-trivial, eg. the branches have diverged or "your unstaged changes would be wiped out by pulling...". Simply erroring out would be sufficient in this case. I intend to ensure that it will never happen through other mechanisms.
For databricks-cli it's the databricks repos update command:
>databricks repos update -h
Usage: databricks repos update [OPTIONS]
Checks out the repo to the given branch or tag. This call returns an error
if the branch or tag doesn't exist.
Options:
--repo-id TEXT Repo ID
--path TEXT Workspace path of the repo object
--branch TEXT Branch name
--tag TEXT Tag name
it will checkout branch even if repo is on the given branch:
databricks repos update --path /Repos/.... --branch releases
You can find the working demo of it in the following repository that shows integration of Repos with Azure DevOps.
For REST API, there is the corresponding endpoint. The only difference from CLI is that it accepts only Repository ID, not the path, but you can find Repos ID from path via Get Status endpoint of Workspace API. You can find an example in the history of the same demo repository (please note that Repos API could change since that time)

Azure DevOps Pipines - Git Respository local directory location

I have created a Pipeline in Azure DevOps and have associated a git repository.
It is cloned to my agent, but I can't get control over in which local directory the repository is cloned to. I am working with self hosted Agent.
The next task need to use a specific file in the repository to complete the task.
The last things tha should happen in the pipline, is push back changes made in the respository.
I think what you want is WorkingDirectory, the local path on the agent where your source code files are downloaded. For example: c:\agent_work\1\s

How can I prevent PRs from changing my CI configuration?

We have an open source project in GitHub. And we use Azure DevOps pipelines for our CI.
We publish our artefacts to S3 and Maven after successful tests, so all the credentials are stored as secret variables.
It's nice that export and echo $top_secret are conveniently obfuscated with ***, but unfortunately literally any user on GitHub can create a pull request against our repo, and as part of the changes, they can edit our azure-pipelines.yml and call a curl (or similar) to read the credentials from environmental variables and send them to their own server.
In other CI providers (Travis CI) secret variables are not accessible from PR branches.
How can I prevent PRs from touching my CI configuration file and do anything with it?
How can I prevent PRs from touching my CI configuration file and do anything with it?
You CI configuration file is save in the GitHub open source and you want to restrict users from changing this file, right? Since we cannot set file permission in the GitHub. we cannot prevent PRs from touching your CI configuration file.
As a workaround, we could create classic editor pipeline in the Azure DevOps and set the CI Trigger, such as below. If users do not have permission to change the build definition, they cannot change your CI build definition.
Update1

Gitlab CI Secrets at user level for deployment login

We have a Gitlab Project with multiple developers, and the repo itself is a conan Project.
When creating a release tag, I want to setup a pipeline which creates the conan package and then uploads it to artifactory. Uploading to the Artifactory requires a username and password login. This is similar to many other deployment jobs where a user+pass authentication is required.
I already found a solution to define secret variables for the project (project level) and use a single account for the whole project to upload to artifactory. This is security-wise an issue, as we want to know who uploaded the conan package, i.e., which user.
Is it somehow in Gitlab possible to define secrets on the user level?
I.e., if User1 creates the tag and has his own Artifactory Account User+Pass secrets set up, the pipeline successfuly pushes the conan package.
If now User2 creates a tag but did not setup secrets, the push should fail.
The following Gitlab issue is a similar description of the problem, but does not contain any solution:
https://gitlab.com/gitlab-org/gitlab/-/issues/15815
Also related: gitlab credentials for specific user (but handles a shared secret with specific user access).
CI secrets are currently only project level, but you might be able to do something similar with one of the predefined env variables. There are four variables that hold info about the Gitlab user who started the pipeline (either by trigger, schedule, push, etc). $GITLAB_USER_EMAIL, $GITLAB_USER_ID, $GITLAB_USER_LOGIN, $GITLAB_USER_NAME. Then, in your projects secret variables, you can store credentials for each of your users, and in your job grab the correct one based on the USER variables.

App Service Editor in Azure

The App Service Editor (Preview) in Azure
When I 'Initialize Git Repository', where is my git repository created? Is there a repository URL that I can use?
And if later, after finish changing my code, I want to export repository (e.g., get a copy to my local machine), how can I do that?
You can access the git repository through command line or via the URL given in your instance dashboard in properties
there should be a Git URL field there.

Resources