Scope is still ideally too much but this account shouldn’t have any access to other repos or We recommend giving the token the smallest scope possible. Save this token for later, when you add a DANGER_GITHUB_API_TOKEN to your CI. Again, the rights that you give to the token depend on the openness of your projects. Here’s the link, you should open this in the private session where you just created the new Note that you should not re-use this bot for OSS projects. The bot requires permission level “Write” to be able to set a PR’s #Closed Source ProjectsĪdd the bot to your repo or to your organization. #OSS Projectsĭo not add the bot to your repo or to your organization. ![]() To get started, open in a private browser session. You are allowed to have one bot per GitHub account. This is a regular GitHub account, but depending on whether you are working on a private or public project, you will want to give different levels of access to this bot. In order to get the most out of Danger, we recommend giving it the ability to post comments in your Pull Requests. Pragmatically, you want to do this though. #Creating a bot account for Danger to use If you need a public PR to test, try: danger-swift pr. This will run un-authenticated so it won’t work with private repos, Leave messages in your terminal, not on the PR. You can now test your current Dangerfile against an existing PR by running: danger-swift pr. If you’re interested in why, see this doc. Let’s try to run your new Dangerfile.swift against an existing PR. Write a Dangerfile, see the guide The Dangerfile. It will output the list of modified files for a PR, which we’ll test next. createdFiles message ( "These files have changed: \( editedFiles. To get yourself started, add this to the Dangerfile.swift in the Xcode project: ![]() Run danger edit - this will create a default Dangerfile.swift and open an Xcode project We’re good with testing builds etc, but SemVer breaks in either project will probably occur and you won’t have a choiceīut to migrate at the same time or face failing builds. This won’t be version locked, so you’ll always be using the latest version of Danger Swift (and Danger JS) which is kinda Now you have a globally installed version of danger that’s available via danger-swift on your computer. Install homebrew, then run brew install danger/tap/danger-swift. This is good for quick experiments, and is macOS only. You’ll have to find a file like this in your codebase, something that just imports Foundation is enough.įrom this point on you can use swift run danger-swift to run Danger locked correctly to your project. This is so that libDanger will be created and because you have to have at least one build Next we create a build target that references a random It gets compiled correctly) by adding Danger as a dependency. This is working around the system a little bit here, we create a SwiftPM build target that requires Danger (to ensure swift-tools-version:4.2 import PackageDescription let package = Package ( name : "Eigen", dependencies :, targets :, path : "Artsy", sources : ), ] )
0 Comments
Leave a Reply. |