brain-score.org submission (user:413) | (public:False) #1264
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automatically merge plugin-only PRs | |
# Triggered on all PRs labeled "automerge-approved" | |
# (Label is set by the "check_if_pr_is_automergeable" workflow) | |
# Confirms PR is automergeable (see check_if_pr_is_automergeable.yml for details) | |
# If PR is automergeable, approves and merges the PR | |
on: | |
pull_request: | |
types: [labeled] | |
permissions: write-all | |
jobs: | |
check_test_results: | |
name: Check if all tests have passed and PR meets automerge conditions | |
runs-on: ubuntu-latest | |
if: contains(github.event.pull_request.labels.*.name, 'automerge-approved') && contains(github.event.pull_request.labels.*.name, 'mapping-complete') | |
outputs: | |
ALL_TESTS_PASS: ${{ steps.gettestresults.outputs.TEST_RESULTS }} | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get test results and ensure automergeable | |
id: gettestresults | |
run: | | |
echo "Checking test results for PR head $( python brainscore_vision/submission/actions_helpers.py get_pr_head )" | |
test_results=$( python brainscore_vision/submission/actions_helpers.py ) | |
echo $test_results | |
echo "TEST_RESULTS=$test_results" >> $GITHUB_OUTPUT | |
automerge: | |
name: If tests pass and PR is automergeable, approve and merge | |
runs-on: ubuntu-latest | |
needs: check_test_results | |
if: needs.check_test_results.outputs.ALL_TESTS_PASS == 'True' | |
steps: | |
- name: Auto Approve | |
uses: hmarr/[email protected] | |
- name: Auto Merge (GitHub submissions) | |
if: contains(github.event.pull_request.labels.*.name, 'automerge') | |
uses: plm9606/[email protected] | |
with: | |
github-token: ${{ secrets.WORKFLOW_TOKEN }} | |
label-name: "automerge" | |
merge-method: "squash" | |
auto-delete: "true" | |
- name: Auto Merge (brain-score.org submissions) | |
if: contains(github.event.pull_request.labels.*.name, 'automerge-web') | |
uses: plm9606/[email protected] | |
with: | |
github-token: ${{ secrets.WORKFLOW_TOKEN }} | |
label-name: "automerge-web" | |
merge-method: "squash" | |
auto-delete: "true" |