diff --git a/.github/workflows/run_experiments.yml b/.github/workflows/run_experiments.yml index 92aa135..d220538 100644 --- a/.github/workflows/run_experiments.yml +++ b/.github/workflows/run_experiments.yml @@ -18,45 +18,45 @@ jobs: METRIQ_TOKEN: ${{ secrets.METRIQ_TOKEN}} steps: - - name: Setup repository on this workflow + - name: Checkout repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: 3.8 - - - name: Install and configure Github CLI - uses: cli/cli/setup@v2.39.1 - with: - gh-version: 2 - + - name: Install tox - run: pip install tox + run: pip install tox - name: Run experiment steps in tox run: tox -ve py38 + + handle_new_artifacts: + runs on: ubuntu-latest + needs: run_experiment_steps - - name: Configure Git with Bot Git Config - run: | - git config user.name "${{ secrets.BOT_USERNAME }}" - git config user.email "${{ secrets.BOT_EMAIL }}" + steps: + - name: Checkout repository + uses: actions/checkout@v4 - - name: Check for updates on result files and open new PR with Bot user - run: | - untracked_csv_files=$(find ./benchmarking/results/ -name '*.csv' -type f) + - name: Check for new artifacts and open new PR with Bot user + run: | + new_csv_files=$(find ./benchmarking/results/ -name '*.csv' -type f) deleted_csv_files=$(git diff --name-only HEAD@{1} HEAD | grep -E '^../results/.*\.csv') - if [ -n "$untracked_csv_files" ] || [ -n "deleted_csv_files"]; then + if [ -n "$new_csv_files" ] || [ -n "deleted_csv_files"]; then git checkout -b bot-branch - git add $untracked_csv_files + git add $new_csv_files git rm $deleted_csv_files git commit -m "Add new result files" git push --set-upstream origin bot-branch - gh pr create --base main --head bot-branch --title "Add new result files" - git checkout main + uses: pullreminders/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: bot-branch + title: "Add new result files" + else + echo "No generated artifacts" fi - env: - BOT_USERNAME: ${{ secrets.BOT_USERNAME }} - BOT_EMAIL: ${{ secrets.BOT_EMAIL }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} +