mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-10-31 15:12:12 +00:00 
			
		
		
		
	Use GitHub API to get correct PR submitter (#2791)
This commit is contained in:
		| @@ -10,14 +10,21 @@ jobs: | |||||||
|     # dependabot PRs are automerged if CI passes; we shouldn't block these |     # dependabot PRs are automerged if CI passes; we shouldn't block these | ||||||
|     if: github.actor != 'dependabot[bot]' |     if: github.actor != 'dependabot[bot]' | ||||||
|     env: |     env: | ||||||
|       PR_SUBMITTER: ${{ github.actor }} |  | ||||||
|       PR_NUMBER: ${{ github.event.number }} |       PR_NUMBER: ${{ github.event.number }} | ||||||
|       PR_BASE: ${{ github.base_ref }} |       PR_BASE: ${{ github.base_ref }} | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|       - name: Fetch PR base |       - name: Fetch PR base | ||||||
|         run: git fetch --no-tags --prune --depth=1 origin |         run: git fetch --no-tags --prune --depth=1 origin | ||||||
|  |  | ||||||
|  |       # cannot use `github.actor`: the triggering commit may be authored by a maintainer | ||||||
|  |       - name: Get PR submitter | ||||||
|  |         id: get-submitter | ||||||
|  |         run: curl -sSfL https://api.github.com/repos/sharkdp/bat/pulls/${PR_NUMBER} | jq -r '"submitter=" + .user.login' | tee -a $GITHUB_OUTPUT | ||||||
|  |  | ||||||
|       - name: Search for added line in changelog |       - name: Search for added line in changelog | ||||||
|  |         env: | ||||||
|  |           PR_SUBMITTER: ${{ steps.get-submitter.outputs.submitter }} | ||||||
|         run: | |         run: | | ||||||
|           ADDED=$(git diff -U0 "origin/${PR_BASE}" HEAD -- CHANGELOG.md | grep -P '^\+[^\+].+$') |           ADDED=$(git diff -U0 "origin/${PR_BASE}" HEAD -- CHANGELOG.md | grep -P '^\+[^\+].+$') | ||||||
|           echo "Added lines in CHANGELOG.md:" |           echo "Added lines in CHANGELOG.md:" | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ | |||||||
| - Upgrade to Rust 2021 edition #2748 (@cyqsimon) | - Upgrade to Rust 2021 edition #2748 (@cyqsimon) | ||||||
| - Refactor and cleanup build script #2756 (@cyqsimon) | - Refactor and cleanup build script #2756 (@cyqsimon) | ||||||
| - Checks changelog has been written to for PRs in CI #2766 (@cyqsimon) | - Checks changelog has been written to for PRs in CI #2766 (@cyqsimon) | ||||||
|  |   - Use GitHub API to get correct PR submitter #2791 (@cyqsimon) | ||||||
| - Minor benchmark script improvements #2768 (@cyqsimon) | - Minor benchmark script improvements #2768 (@cyqsimon) | ||||||
| - Update and improve `zsh` completion, see #2772 (@okapia) | - Update and improve `zsh` completion, see #2772 (@okapia) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user