-
Notifications
You must be signed in to change notification settings - Fork 54
47 lines (46 loc) · 1.95 KB
/
pytorch-latest-release.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
name: Get latest PyTorch version release branch
on:
workflow_dispatch:
env:
working_branch: support/new-pytorch-${{ github.ref_name }}
base_branch: ${{ github.ref_name }}
permissions:
contents: write
issues: write
pull-requests: write
jobs:
get-version:
runs-on: ubuntu-latest
if: ${{ github.repository }} == 'hemlholtz-analytics/heat'
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: '${{ env.base_branch }}'
- name: Fetch PyTorch release version
run: |
curl -sL https://api.github.com/repos/pytorch/pytorch/releases/latest | \
jq -r ".tag_name" | tr -d 'v' > .github/pytorch-release-versions/pytorch-latest.txt
- name: Check if file has been modified
id: git-check
run: echo "::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true")"
- name: Delete working branch if it already exists
run: git push --delete origin ${{ env.working_branch }} || true
- name: Commit latest PyTorch release version to new branch
if: ${{ steps.git-check.outputs.modified == 'true' }}
run: |
git checkout -b ${{ env.working_branch }}
echo "new=$(<.github/pytorch-release-versions/pytorch-latest.txt)" >> $GITHUB_ENV
git config --global user.name 'ClaudiaComito'
git config --global user.email '[email protected]@users.noreply.github.com'
git commit -am "New PyTorch release ${{ env.new }}"
git push --set-upstream origin ${{ env.working_branch }}
call-workflow:
needs: get-version
uses: ./.github/workflows/latest-pytorch-support.yml
with:
working_branch: support/new-pytorch-${{ github.ref_name }}
base_branch: ${{ github.ref_name }}