forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.83 KB
/
update-viablestrict.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Update viable/strict
on:
schedule:
- cron: 17,47 * * * *
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
do_update_viablestrict:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.MERGEBOT_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
architecture: x64
check-latest: false
cache: pip
cache-dependency-path: |
**/.ci/docker/requirements-ci.txt
**/.github/requirements-gha-cache.txt
- name: Install Python Packages
run: |
pip3 install rockset==1.0.3
pip3 install boto3==1.19.12
- name: Get latest viable commit
env:
ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }}
run: |
output=$(python3 .github/scripts/fetch_latest_green_commit.py)
echo "latest_viable_sha=$output" >> "${GITHUB_OUTPUT}"
id: get-latest-commit
- name: Push SHA to viable/strict branch
if: steps.get-latest-commit.outputs.latest_viable_sha != 'None'
env:
GITHUB_TOKEN: ${{ secrets.MERGEBOT_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "PyTorch MergeBot"
echo "Set the latest sha variable to be ${{ steps.get-latest-commit.outputs.latest_viable_sha }}"
# Pushing an older green commit here will fail because it's non-fast-forward, which is ok
# to ignore because we already have the later green commit in visable/strict
git push origin "${{ steps.get-latest-commit.outputs.latest_viable_sha }}":viable/strict || true