mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
Pined hashes updates to be done by @pytorchupdatebot As mergebot token access is restricted to environment <!-- copilot:poem --> ### <samp>🤖 Generated by Copilot at d57c0f4</samp> > _`UPDATEBOT_TOKEN`_ > _A new name for the night_ > _Autumn leaves falling_ Pull Request resolved: https://github.com/pytorch/pytorch/pull/101723 Approved by: https://github.com/huydhn
64 lines
2 KiB
YAML
64 lines
2 KiB
YAML
name: update-commit-hash
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
repo-owner:
|
|
required: false
|
|
type: string
|
|
description: Name of repository's owner.
|
|
default: pytorch
|
|
repo-name:
|
|
required: true
|
|
type: string
|
|
description: Name of the repository we're updating commit hash for.
|
|
branch:
|
|
required: true
|
|
type: string
|
|
description: Branch to fetch commit of
|
|
pin-folder:
|
|
type: string
|
|
description: Path to folder with commit pin
|
|
required: false
|
|
default: .github/ci_commit_pins
|
|
secrets:
|
|
UPDATEBOT_TOKEN:
|
|
required: true
|
|
description: Permissions for opening PR
|
|
PYTORCHBOT_TOKEN:
|
|
required: true
|
|
description: Permissions for approving PR
|
|
|
|
env:
|
|
NEW_BRANCH_NAME: update-${{ inputs.repo-name }}-commit-hash/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
|
|
|
|
jobs:
|
|
update-commit-hash:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 1
|
|
submodules: false
|
|
token: ${{ secrets.UPDATEBOT_TOKEN }}
|
|
|
|
- name: Checkout
|
|
shell: bash
|
|
run: |
|
|
git clone https://github.com/${{ inputs.repo-owner }}/${{ inputs.repo-name }}.git --quiet
|
|
|
|
- name: Check if there already exists a PR
|
|
shell: bash
|
|
env:
|
|
REPO_NAME: ${{ inputs.repo-name }}
|
|
BRANCH: ${{ inputs.branch }}
|
|
PIN_FOLDER: ${{ inputs.pin-folder }}
|
|
UPDATEBOT_TOKEN: ${{ secrets.UPDATEBOT_TOKEN }}
|
|
PYTORCHBOT_TOKEN: ${{ secrets.PYTORCHBOT_TOKEN }}
|
|
run: |
|
|
# put this here instead of the script to prevent accidentally changing the config when running the script locally
|
|
git config --global user.name "PyTorch UpdateBot"
|
|
git config --global user.email "pytorchupdatebot@users.noreply.github.com"
|
|
|
|
python .github/scripts/update_commit_hashes.py --repo-name "${REPO_NAME}" --branch "${BRANCH}" --pin-folder "${PIN_FOLDER}"
|