Skip to content

Commit

Permalink
Use jq to get patch author information
Browse files Browse the repository at this point in the history
  • Loading branch information
jlb6740 committed Sep 13, 2022
1 parent 486b77d commit f809539
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,24 @@ jobs:
Wasmtime_Repo_On_PR_Comment:
name: Benchmark x64 on PR comment Wasmtime repo
runs-on: ubuntu-latest
# if: (github.event_name == 'push') && (github.repository != 'bytecodealliance/wasmtime-sightglass-benchmarking')
# if: |
# startsWith(github.event.review_comment.body, '/bench_x64')
# if: (github.event_name == 'pull_request_review') && (github.repository == 'bytecodealliance/wasmtime-sightglass-benchmarking')
if: |
(github.event_name == 'pull_request_review') &&
(startsWith(github.event.review.body, '/bench_x64')) &&
(('abrown' == github.event.review.user.login)
|| ('afonso360' == github.event.review.user.login)
|| ('akirilov-arm' == github.event.review.user.login)
|| ('alexcrichton' == github.event.review.user.login)
|| ('bbouvier' == github.event.review.user.login)
|| ('bjorn3' == github.event.review.user.login)
|| ('cfallin' == github.event.review.user.login)
|| ('fitzgen' == github.event.review.user.login)
|| ('jlb6740' == github.event.review.user.login)
|| ('sparker-arm' == github.event.review.user.login)
|| ('uweigand' == github.event.review.user.login))
steps:
- run: echo "MESSAGE=Requested from pull request comment." >> $GITHUB_ENV
- run: echo "ACTOR=${{ github.event.comment.user.login }}" >> $GITHUB_ENV
- run: echo "ACTOR=${{ github.event.review.user.login }}" >> $GITHUB_ENV
- run: echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
- run: echo "REFS=${{ github.ref }}" >> $GITHUB_ENV
- run: echo "PR_NUMBER=${{ github.event.issue.number }}" >> $GITHUB_ENV
Expand All @@ -44,10 +56,11 @@ jobs:
git checkout wasmtime/${{ github.ref_name }} -b ${{ github.ref_name }}
git submodule update --init --recursive
git checkout -b wasmtime-performance-testing/FB/${{ github.ref_name }}/${{ github.sha }}
echo ${{ github.event.commits[0].committer.name }}
echo "email - ${{ github.event.commits[0].committer.email }}"
git config user.name '${{ github.event.commits[0].committer.name }}'
git config user.email '${{ github.event.commits[0].committer.email }}'
apt install jq
echo $(curl -sSL https://api.github.com/repos/jlb6740/wasmtime/pulls/10/commits | jq -r '.[].commit.committer.name')
echo $(curl -sSL https://api.github.com/repos/jlb6740/wasmtime/pulls/10/commits | jq -r '.[].commit.committer.email')
git config user.name $(curl -sSL https://api.github.com/repos/jlb6740/wasmtime/pulls/10/commits | jq -r '.[].commit.committer.name')
git config user.email $(curl -sSL https://api.github.com/repos/jlb6740/wasmtime/pulls/10/commits | jq -r '.[].commit.committer.email')
git commit --allow-empty -m "${GITHUB_CONTEXT}"
git push origin wasmtime-performance-testing/FB/${{ github.ref_name }}/${{ github.sha }}
#curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ env.TOKEN }}" https://api.github.com/repos/bytecodealliance/wasmtime-sightglass-benchmarking/dispatches -d '{"event_type":"Performance Testing", "client_payload":{"message":"${{ env.MESSAGE }}", "actor":"${{ env.ACTOR }}", "repository":"${{ env.REPOSITORY }}", "ref":"${{ env.REFS }}", "pr_number":"${{ env.PR_NUMBER }}", "publish":"${{ env.PUBLISH }}" }'
Expand Down

0 comments on commit f809539

Please sign in to comment.