Sourcetree または別のアプリに API トークンを追加する
現在、Bitbucket での認証にアプリ パスワードを使用しているサードパーティ アプリの場合、ユーザー名を Atlassian メールに置き換え、アプリ パスワードを新たに生成された API トークンに置き換えることで、API トークンに移行できます。
To get started using API tokens with Sourcetree, you'll need to create the API token in Bitbucket Cloud and specify the necessary scope to connect to your account, view your workspaces, and work with your repositories in Sourcetree.
スコープ付き API トークンを作成する
Select your profile in the upper-right corner of the top navigation bar.
Under Account settings.
Atlassian アカウント ページの上部のナビゲーション バーにある [セキュリティ] タブを選択します。
[API トークンの作成と管理] を選択します。
Select Create API token with scopes. If you want to be able to authenticate against your user account, view your data, and work with your repositories (clone/push/pull to the repoository and work with pull requests (optional), you will need to select all of the following scopes:
read:user:bitbucket
read:workspace:bitbucket
read:repository:bitbucket
write:repository:bitbucket
read:pullrequest:bitbucket (optional)
write:pullrequest:bitbucket (optional)
More information on scopes can be found in our API scopes documentation.API トークンに名前と有効期限を指定し (通常は、トークンを使用するアプリに関連するものを指定する)、[次へ] を選択します。
アプリとして [Bitbucket] を選択し、[次へ] を選択します。
Select the scopes (permissions) the API token needs and select Next. For detailed descriptions of each permission, see: API Token permissions. Note: This step is required for your API token to access Bitbucket APIs or perform Git commands.
トークンを確認し、[トークンを作成] ボタンを選択します。ページに新しい API トークンが表示されます。
生成された API トークンをコピーして、記録するか、アクセス権を付与するアプリに貼り付けます。
Configure Sourcetree to work with your API token
Sourcetree に API トークンを追加するには、次の手順に従います。
はじめる前に
Make sure you're on at least Sourcetree v4.2.14 (Mac) or Sourcetree v3.4.24 (Windows) by selecting Check for Updates and installing the necessary version or any updates. These versions and above fully support API tokens, and thus, you will need to update to the latest version, as you will encounter issues with older versions. You can confirm that the update was successful by selecting About Sourcetree and checking the version.
アカウント情報を追加または編集するタブに移動します。
(Windows) Go to Tools, then Options. From the Options dialog, select the Authentication tab.
(macOS) Go to Sourcetree, then Preferences. From the dialog that options, select the Accounts tab.
[編集] を選択してアカウントの詳細を編集するか、[追加] を選択して新しいアカウントを追加します。
Select Bitbucket as the host.
Select API Token as the Auth Type.
Enter the user email associated with your Bitbucket Cloud user account into the User Email field.
Paste your API token from above into the API Token field.
[OK] または [保存] を選択してアカウントの詳細を保存します。
Cloning a repository in Sourcetree
Once you’re ready to clone a new remote repository, select the Remote tab.
Find the repository you wish to clone and select the Clone button. This will clone the repository using the API token that you've configured in Sourcetree.
Working with existing repositories
By updating your configuration with your API token, Sourcetree will automatically update the remote repository authentication, so you may continue working with these repositories as normal.
その他の考慮事項
As API tokens have a configurable expiry date, once the expiry date has passed, you will need to create a new API token and configure your settings in Sourcetree to reflect this new token as outlined in the above processes.
Renovate
Renovate ボットに API トークンを追加するには、次の手順に従います。
config.jsファイルのpasswordとして API トークンを設定します。環境変数
RENOVATE_PASSWORDとして API トークンを設定します。CLI で
--password=を使用して Renovate を実行するときに API トークンを設定します。bot アカウントの
usernameを Atlassian メールとして設定します。
Other third-party applications
API トークンを別のアプリに追加する場合は、アプリのドキュメントで API トークンの適用方法を参照してください。
Bitbucket での認証にアプリ パスワードを使用するその他のアプリについては、ユーザー名を Atlassian メールに置き換え、以前のアプリ パスワードを新たに生成された API トークンに置き換えます。
この内容はお役に立ちましたか?