forked from scikit-learn/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Adam Li <adam2392@gmail.com>
- Loading branch information
Showing
47 changed files
with
827 additions
and
246 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Workflow to update lock files in a PR, triggered by specific PR comments | ||
name: Update lock files in PR | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
update-lock-files: | ||
if: >- | ||
github.event.issue.pull_request | ||
&& startsWith(github.event.comment.body, '@scikit-learn-bot update lock-files') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# There is no direct way to get the HEAD information directly from issue_comment | ||
# event, so we use the GitHub CLI to get the PR head ref and repository | ||
- name: Get pull request HEAD information | ||
id: pr-head-info | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pr_info=$(gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} --json headRefName,headRepository,headRepositoryOwner) | ||
pr_head_ref=$(echo "$pr_info" | jq -r '.headRefName') | ||
pr_head_repository=$(echo "$pr_info" | jq -r '.headRepositoryOwner.login + "/" + .headRepository.name') | ||
echo "pr_head_ref=$pr_head_ref" >> $GITHUB_OUTPUT | ||
echo "pr_head_repository=$pr_head_repository" >> $GITHUB_OUTPUT | ||
- name: Check out the PR branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ steps.pr-head-info.outputs.pr_head_ref }} | ||
repository: ${{ steps.pr-head-info.outputs.pr_head_repository }} | ||
|
||
# We overwrite all the scripts we are going to use in this workflow with their | ||
# versions on main; since this workflow has the write permissions this is to avoid | ||
# malicious changes to these scripts in PRs to be executed | ||
- name: Download scripts from main | ||
run: | | ||
curl https://raw.githubusercontent.com/${{ github.repository }}/comment-update-lock/build_tools/shared.sh --retry 5 -o ./build_tools/shared.sh | ||
curl https://raw.githubusercontent.com/${{ github.repository }}/comment-update-lock/build_tools/update_environments_and_lock_files.py --retry 5 -o ./build_tools/update_environments_and_lock_files.py | ||
curl https://raw.githubusercontent.com/${{ github.repository }}/comment-update-lock/build_tools/on_pr_comment_update_environments_and_lock_files.py --retry 5 -o ./build_tools/on_pr_comment_update_environments_and_lock_files.py | ||
- name: Update lock files | ||
env: | ||
COMMENT: ${{ github.event.comment.body }} | ||
# We download the lock files update scripts from main, since this workflow is | ||
# run from main itself | ||
run: | | ||
source build_tools/shared.sh | ||
source $CONDA/bin/activate | ||
conda install -n base conda conda-libmamba-solver -y | ||
conda config --set solver libmamba | ||
conda install -c conda-forge "$(get_dep conda-lock min)" -y | ||
python build_tools/on_pr_comment_update_environments_and_lock_files.py |
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
56 changes: 28 additions & 28 deletions
56
build_tools/azure/pylatest_conda_forge_mkl_linux-64_conda.lock
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.