Skip to content

Commit

Permalink
Merge pull request #93 from sebcrozet/ci-fix-pull-request-target
Browse files Browse the repository at this point in the history
Fix CI bench message emission for fork PRs.
  • Loading branch information
sebcrozet authored Jan 22, 2021
2 parents be185a3 + 0f5159d commit b61bec8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/rapier-ci-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ jobs:
BENCHBOT_AMQP_PASS: ${{ secrets.BENCHBOT_AMQP_PASS }}
BENCHBOT_AMQP_VHOST: ${{ secrets.BENCHBOT_AMQP_VHOST }}
BENCHBOT_AMQP_HOST: ${{ secrets.BENCHBOT_AMQP_HOST }}
BENCHBOT_TARGET_REPO: ${{ github.repository }}
BENCHBOT_TARGET_REPO: ${{ github.event.pull_request.head.repo.clone_url }}
BENCHBOT_TARGET_COMMIT: ${{ github.event.pull_request.head.sha }}
BENCHBOT_SHA: ${{ github.sha }}
BENCHBOT_HEAD_REF: ${{github.head_ref}}
BENCHBOT_HEAD_REF: ${{ github.head_ref }}
BENCHBOT_OTHER_BACKENDS: false
runs-on: ubuntu-latest
steps:
- name: Find commit SHA
if: github.ref == 'refs/heads/master'
- name: Set env on master
if: github.head_ref == ''
run: |
echo "BENCHBOT_TARGET_COMMIT=$BENCHBOT_SHA" >> $GITHUB_ENV
echo "BENCHBOT_TARGET_REPO=https://github.com/dimforge/rapier" >> $GITHUB_ENV
echo "BENCHBOT_HEAD_REF=master" >> $GITHUB_ENV
echo "BENCHBOT_OTHER_BACKENDS=true" >> $GITHUB_ENV
- name: Send 3D bench message
shell: bash
run: curl -u $BENCHBOT_AMQP_USER:$BENCHBOT_AMQP_PASS
-i -H "content-type:application/json" -X POST
https://$BENCHBOT_AMQP_HOST/api/exchanges/$BENCHBOT_AMQP_VHOST//publish
-d'{"properties":{},"routing_key":"benchmark","payload":"{ \"repository\":\"https://github.com/'$BENCHBOT_TARGET_REPO'\", \"branch\":\"'$GITHUB_REF'\", \"commit\":\"'$BENCHBOT_TARGET_COMMIT'\", \"other_backends\":'$BENCHBOT_OTHER_BACKENDS' }","payload_encoding":"string"}'
-d'{"properties":{},"routing_key":"benchmark","payload":"{ \"repository\":\"'$BENCHBOT_TARGET_REPO'\", \"branch\":\"'$BENCHBOT_HEAD_REF'\", \"commit\":\"'$BENCHBOT_TARGET_COMMIT'\", \"other_backends\":'$BENCHBOT_OTHER_BACKENDS' }","payload_encoding":"string"}'

0 comments on commit b61bec8

Please sign in to comment.