Sync data from eval-pipeline #3
Workflow file for this run
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: Sync data from eval-pipeline | |
on: | |
pull_request: | |
# TODO XXX replace with | |
# push: | |
# branches: [main] | |
jobs: | |
sync-data: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref || github.ref }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Poetry | |
run: pipx install poetry==1.8.3 | |
- name: Install python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: poetry | |
- name: poetry install | |
run: |- | |
poetry install | |
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH | |
- name: Configure SSH | |
run: |- | |
eval `ssh-agent -s` | |
ssh-add - <<< "${{ secrets.EVAL_PIPELINE_DEPLOY_KEY }}" | |
mkdir -p ~/.ssh | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> $GITHUB_ENV | |
echo "SSH_AGENT_PID=${SSH_AGENT_PID}" >> $GITHUB_ENV | |
- name: Fetch data and commit back to repo | |
run: |- | |
git status | |
dvc get --force [email protected]:METR/eval-pipeline public/data/external/all_runs.jsonl -o data/external/all_runs.jsonl --remote-config access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }} secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
if git diff --name-only --exit-code | |
then | |
echo "No changes" | |
exit 0 | |
fi | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -am "Update data from eval-pipeline" | |
echo "Pushing..." | |
git push origin HEAD:${{ github.head_ref }} |