GitHub Action Bot 冷知識

讓 GitHub Actions Bot 的 Commit 變成 Verified 今天才知道,原來 GitHub Actions 自動 commit 的時候,是可以讓那個 commit 顯示 verified 標籤的。 關鍵就是把 git 的 user email 設成 GitHub Actions bot 專屬的 email: git config user.name "github-a...

By · · 1 min read
GitHub Action Bot 冷知識

Source: DEV Community

讓 GitHub Actions Bot 的 Commit 變成 Verified 今天才知道,原來 GitHub Actions 自動 commit 的時候,是可以讓那個 commit 顯示 verified 標籤的。 關鍵就是把 git 的 user email 設成 GitHub Actions bot 專屬的 email: git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" 設完之後正常 commit 就好,GitHub 會自動認得這是它家的 bot,直接幫你掛上 verified。 建立 PR 也適用 如果你跟我一樣,除了 commit 還需要 action 自動開 PR,一樣可以用這組 email。像我是用 peter-evans/create-pull-request 這個 action: - name: Create Pull Request uses: peter-evans/create-pull-request@v8 with: token: ${{ secrets.GITHUB_TOKEN }} committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> 那個 41898282 是什麼? 這串數字是 GitHub Actions bot 的 user ID。每個 bot 帳號都有自己的 ID,email 格式就是 {id}+{username}@users.noreply.github.com。 這個 ID 看起來沒有公開的官方文件記錄,不過可以直接用 GitHub API 查: # GitHub Actions bot curl -s https://api.github.com/users/github-actions%5Bbot%5D | grep

Similar Topics

#artificial intelligence (31552) #data science (24017) #ai (16747) #crypto (15110) #machine learning (14680) #crypto news (11112) #research (8564) #programming (3999) #events (3308) #python (1819) #education (1667) #data analysis (1305) #science and technology (746) #artificial intelligence_ (662) #community (596) #coding (592) #developer skills (570) #hacks (541) #features (440) #software engineering (378)

Related Posts

Trending on ShareHub

Latest on ShareHub

Browse Topics

#artificial intelligence (31552) #data science (24017) #ai (16738) #generative ai (15034) #crypto (14987) #machine learning (14680) #bitcoin (14229) #featured (13550) #news & insights (13064) #crypto news (11082)

Around the Network