Skip to content

Commit

Permalink
Make GHA workflow to retrieve latest promote-able SHA from master (#7…
Browse files Browse the repository at this point in the history
…9548)

Relates to #76700

**Overview:** Wrote GHA to get the latest commit SHA. Another component of the script is pushing this SHA to the viable/strict branch but I'm planning to test that locally after verifying that this part is correct.

**Test Plan:** Monitor github actions results to see if the SHA printed is correct -- I wasn't able to check this on my personal fork.
Pull Request resolved: #79548
Approved by: https://github.com/seemethere
  • Loading branch information
swang392 authored and pytorchmergebot committed Jun 14, 2022
1 parent f614f66 commit e479dae
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/update-viablestrict.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update viable/strict

on:
schedule:
- cron: 17,47 * * * *
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
do_update_viablestrict:
runs-on: ubuntu-20.04
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64

- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master

- name: Install Python Packages
run: |
pip3 install rockset==0.8.10
pip3 install boto3==1.19.12
pip3 install six==1.16.0
- name: Get latest viable commit
env:
ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }}
run: |
output=$(python3 -m .github/scripts/print_latest_commits.py)
echo "::set-output name=latest_viable_sha::$output"
id: get-latest-commit

- name: Push SHA to viable/strict branch
env:
GITHUB_TOKEN: ${{ secrets.MERGEBOT_TOKEN }}
run: |
git config --global user.email "pytorchmergebot@users.noreply.github.com"
git config --global user.name "PyTorch MergeBot"
echo "::debug::Set the latest sha variable to be ${{ steps.get-latest-commit.outputs.latest_viable_sha }}"

0 comments on commit e479dae

Please sign in to comment.