使用 Power BI 連接到 GitHubConnect to GitHub with Power BI

適用於 Power BI 的 GitHub 內容套件可讓您藉由參與、問題、提取要求和作用中的使用者相關資料,深入了解 GitHub 儲存機制 (也稱為 repo)。The GitHub content pack for Power BI allows you to gain insights into a GitHub repository (also known as repo) with data around contributions, issues, pull requests and active users.

連接到 GitHub 內容套件或深入了解 Power BI 與 GitHub 的整合Connect to the GitHub content pack or read more about the GitHub integration with Power BI.

注意

此內容套件需要能夠存取此儲存機制的 GitHub 帳戶。The content pack requires the GitHub account to have access to the repo. 下方有需求的詳細資料。More details on requirements below.

如何連接How to connect

  1. 選取左側瀏覽窗格底部的 [取得資料] 。Select Get Data at the bottom of the left navigation pane.

  2. 在 [服務] 方塊中,選取 [取得] 。In the Services box, select Get.

  3. 選取 [GitHub] [取得]> 。Select GitHub > Get.

  4. 輸入該儲存機制的儲存機制名稱和儲存機制擁有者。Enter the repository name and repository owner of the repo. 請參閱以下關於尋找這些參數的詳細資料。See details on finding these parameters below.

  5. 請提供您的 GitHub 認證 (如果您已經登入瀏覽器,此步驟可能會略過)。Enter your GitHub credentials (this step might be skipped if you are already signed in with your browser).
  6. 針對 [驗證方法] 選取 [oAuth2] > [登入]。For Authentication Method, select oAuth2 > Sign In.
  7. 請遵循 GitHub 驗證畫面進行。Follow the Github authentication screens. 授與適用於 GitHub 的 Power BI 內容套件對於 GitHub 資料之權限。Grant the GitHub for Power BI content pack permission to the GitHub data.

    這會連接 Power BI 與 GitHub ,並可讓 Power BI 連接到資料。This connects Power BI with GitHub and allows Power BI to connect to the data. 資料會每天重新整理一次。The data is refreshed once a day.

  8. 連接到儲存機制之後,Power BI 會匯入資料。After you connect to your repo, Power BI imports the data. 您會在左功能窗格中看到新的 GitHub 儀表板、報表和資料集。You see a new GitHub dashboard, report, and dataset in the left navigation pane. 新的項目會以黃色星號標示*。New items are marked with a yellow asterisk *.

接下來呢?What now?

包含的內容What's included

在 Power BI 中 GitHub 提供下列資料:The following data is available from GitHub in Power BI:

資料表名稱Table name 描述Description
參與Contributions 參與資料表提供每週彙總參與者所撰寫的總計新增、刪除和認可。The contributions table gives the total additions, deletions and commits authored by the contributor aggregated per week. 包含前 100 名參與者。The top 100 contributors are included.
問題Issues 列出所有選取儲存機制的問題,其中包含計算,像是已解決問題的總計和平均時間、未解決問題總數、已解決問題總數。List all issues for the selected repo and it contains calculations like total and average time to close an issue, Total open issues, Total closed issues. 當儲存機制中沒有任何問題時,此資料表為空白。This table will be empty when there are no issues in the repo.
提取要求Pull requests 此表格包含此儲存機制和提取要求者之所有提取要求。This table contains all the Pull Requests for the repo and who pulled the request. 它也包含相關計算,像是有多少未解決、已解決和總計的提取要求,花多少時間來提取這些要求,以及提取要求所耗用平均時間。It also contains calculations around how many open, closed and total pull requests, how long it took to pull the requests and how long the average pull request took. 當儲存機制中沒有任何問題時,此資料表為空白。This table will be empty when there are no issues in the repo.
使用者Users 下表提供 GitHub 使用者或參與者的清單,他們針對選取的儲存機制參與、提出問題或解決提取要求。This table provides a list of GitHub users or contributors who have made contributions, filed issues or solved Pull requests for the repo selected.
里程碑Milestones 它具有所選儲存機制的所有里程碑。It has all the Milestones for the selected repo.
DateTableDateTable 此資料表包含從今天開始推算,過去幾年來的日期,可讓您依日期分析 GitHub 資料。This tables contains dates from today and for years in the past that allow you to analyze your GitHub data by date.
ContributionPunchCardContributionPunchCard 這個資料表可以當做所選取儲存機制的參與穿孔卡片。This table can be used as a contribution punch card for the selected repo. 它會依一週中各天和一天中各小時顯示認可。It shows commits by day of week and hour of day. 此資料表未連接到模型中的其他資料表。This table is not connected to other tables in the model.
RepoDetailsRepoDetails 此資料表會提供選取的儲存機制詳細資料。This table provides details for the repo selected.

系統需求System requirements

  • 可存取儲存機制的 GitHub 帳戶。The GitHub account that has access to the repo.
  • 第一次登入期間授與適用於 GitHub 應用程式之 Power BI 的權限。Permission granted to the Power BI for GitHub app during first login. 請參閱以下撤銷存取權的詳細資訊。See details below on revoking access.
  • 有足夠可用的 API 呼叫,以便提取和重新整理資料。Sufficient API calls available to pull and refresh the data.

取消授權 Power BIDe-authorize Power BI

若要將 Power BI 從 GitHub 儲存機制的連接取消授權,您可以撤銷 GitHub 中的存取。To de-authorize Power BI from being connected to your GitHub repo you can Revoke access in GitHub. 如需詳細資訊,請參閱 GitHub 說明主題。For more details see this GitHub help topic.

尋找參數Finding parameters

您可以查看在 GitHub 本身的儲存機制來判斷擁有者和儲存機制:You can determine the owner and repository by looking at the repository in GitHub itself:

第一個部分的 "Azure" 是擁有者,而第二個部分 "azure-sdk-for-php" 是儲存機制本身。The first part "Azure" is the owner and the second part "azure-sdk-for-php" is the repository itself. 您會在儲存機制的 URL 中看到這兩個相同項目:You see these same two items in the URL of the repository:

<https://github.com/Azure/azure-sdk-for-php> .

疑難排解Troubleshooting

如有必要,您可以確認您的 GitHub 認證。If necessary, you can verify your GitHub credentials.

  1. 在另一個瀏覽器視窗中,移至 GitHub 網站並登入 GitHub。In another browser window, go to the GitHub web site and log in to GitHub. 在 GitHub 網站右上角,可以看到您已登入。You can see you’re logged in, in the upper-right corner of the GitHub site.
  2. 在 GitHub 中瀏覽至您計劃要在 Power BI 中存取之儲存機制的 URL。In GitHub, navigate to the URL of the repo you plan to access in Power BI. 例如︰https://github.com/dotnet/corefx。For example: https://github.com/dotnet/corefx.
  3. 回到 Power BI,嘗試連接至 GitHub。Back in Power BI, try connecting to GitHub. 在 [設定 GitHub] 對話方塊中,請使用相同儲存機制的儲存機制名稱和儲存機制擁有者名稱。In the Configure GitHub dialog box, use the names of the repo and repo owner for that same repo.

後續步驟Next steps