mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
- Per [deprecation announcement](https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/) replace `echo "::set-output name="` with echo to `${GITHUB_OUTPUT}` as shown in following [example](https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs#example-defining-outputs-for-a-job)
- Update `actions/setup-python` from `v2` to `v4` to get rid of deprecated node version warning
- Update `actions/checkout-python` from `v2` to `v3` (and `silent-checkout` branch as well)
- Update `retry` action to 3e91a01664
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87152
Approved by: https://github.com/kit1980, https://github.com/izaitsevfb
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
name: update-commit-hash
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
repo-name:
|
|
required: true
|
|
type: string
|
|
description: Name of the repository we're updating commit hash for. Must be in pytorch org.
|
|
branch:
|
|
required: true
|
|
type: string
|
|
description: Branch to fetch commit of
|
|
secrets:
|
|
MERGEBOT_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-xla-commit-hash:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 1
|
|
submodules: false
|
|
token: ${{ secrets.MERGEBOT_TOKEN }}
|
|
|
|
- name: Checkout
|
|
shell: bash
|
|
run: |
|
|
git clone https://github.com/pytorch/${{ inputs.repo-name }}.git --quiet
|
|
|
|
- name: Check if there already exists a PR
|
|
shell: bash
|
|
env:
|
|
REPO_NAME: ${{ inputs.repo-name }}
|
|
BRANCH: ${{ inputs.branch }}
|
|
MERGEBOT_TOKEN: ${{ secrets.MERGEBOT_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 MergeBot"
|
|
git config --global user.email "pytorchmergebot@users.noreply.github.com"
|
|
|
|
python .github/scripts/update_commit_hashes.py --repo-name "${REPO_NAME}" --branch "${BRANCH}"
|