Skip to content

Commit

Permalink
Clean up scoring action (#500)
Browse files Browse the repository at this point in the history
* check array for automerge-web label

* upgrade get-github-email-by-username-action version

* fix BS_UID reference

* cleanup

* typo

* typo

---------

Co-authored-by: Katherine Fairchild <[email protected]>
  • Loading branch information
kvfairchild and Katherine Fairchild authored Jan 11, 2024
1 parent e7b0b7e commit ede29dc
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/score_new_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ jobs:
- name: Get plugin info
id: getpluginfo
run: |
echo "PLUGIN_INFO='$(python -c 'from brainscore_core.plugin_management.parse_plugin_changes import get_scoring_info; get_scoring_info("${{ env.CHANGED_FILES }}", "brainscore_vision")')'" >> $GITHUB_OUTPUT
printf -v PLUGIN_INFO "%s" "$(python -c 'from brainscore_core.plugin_management.parse_plugin_changes import get_scoring_info; get_scoring_info("brainscore_vision/models/regnet/__init__.py brainscore_vision/models/regnet/model.py brainscore_vision/models/regnet/test.py ", "brainscore_vision")')"
echo "PLUGIN_INFO=$PLUGIN_INFO" >> $GITHUB_OUTPUT
- name: Run scoring
id: runscore
Expand All @@ -69,21 +70,17 @@ jobs:
outputs:
PLUGIN_INFO: steps.add_email_to_pluginfo.outputs.PLUGIN_INFO
steps:
- name: Parse user ID from PR title (WEB ONLY where we don't have access to the GitHub user)
id: getuid
if: github.event.pull_request.labels.*.name == 'automerge-web'
run: |
echo "BS_UID="$(<<<${{ github.event.pull_request.title }} | sed -E 's/.*\(user:([^)]+)\).*/\1/'"" >> $GITHUB_ENV
- name: Add user ID to PLUGIN_INFO (WEB ONLY)
- name: Parse user ID from PR title and add to PLUGIN_INFO (WEB ONLY where we don't have access to the GitHub user)
id: add_uid_to_pluginfo
if: github.event.pull_request.labels.*.name == 'automerge-web'
if: contains(github.event.pull_request.labels.*.name, 'automerge-web')
run: |
echo "The Brain-Score user ID is ${{ steps.getuid.outputs.BS_UID }}"
echo "PLUGIN_INFO="$(<<<$PLUGIN_INFO jq '. + {user_id: ${{ steps.getuid.outputs.UID }} }')"" >> $GITHUB_ENV
BS_UID="$(<<<${{ github.event.pull_request.title }} sed -E 's/.*\(user:([^)]+)\).*/\1/')"
echo "The Brain-Score user ID is $BS_UID"
echo "PLUGIN_INFO="$(<<<$PLUGIN_INFO jq '. + {user_id: ${{ steps.getuid.outputs.BS_UID }} }')"" >> $GITHUB_ENV
- name: Get PR author email from GitHub username
id: getemail
uses: evvanErb/get-github-email-by-username-action@v1.25
uses: evvanErb/get-github-email-by-username-action@v2.0
with:
github-username: ${{github.event.pull_request.user.login}} # PR author's username
token: ${{ secrets.GITHUB_TOKEN }} # Including token enables most reliable way to get a user's email
Expand Down Expand Up @@ -124,4 +121,4 @@ jobs:
- name: Run scoring
run: |
python -c 'from brainscore_core.submission.endpoints import call_jenkins; call_jenkins('\''${{ env.PLUGIN_INFO }}'\'')'
python -c "from brainscore_core.submission.endpoints import call_jenkins; call_jenkins('\''${{ env.PLUGIN_INFO }}'\'')"

0 comments on commit ede29dc

Please sign in to comment.