-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (51 loc) · 2.4 KB
/
update-pangolin.yaml
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
57
58
59
60
61
name: Check for new pangolin Release
on:
schedule:
# At the end of every day
- cron: "0 0 * * *"
jobs:
Create-PR-for-new-Pangolin-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install mamba
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: bioconda,conda-forge,defaults
channel-priority: true
- name: Get latest Pangolin release
shell: bash -l {0}
run: |
echo "LATEST_PANGOLIN=$(mamba search -f pangolin -c bioconda | tail -n1 | awk '{print $2}')" >> $GITHUB_ENV
echo "Latest Pangolin release: $(mamba search -f pangolin -c bioconda | tail -n1 | awk '{print $2}')"
- name: Get Pangolin release used in UnCoVar
run: |
echo "CURRENT_PANGOLIN=$(cat workflow/envs/pangolin.yaml | grep pangolin | awk -F "=" '{print $2}')" >> $GITHUB_ENV
echo "Current Pangolin release: $(cat workflow/envs/pangolin.yaml | grep pangolin | awk -F "=" '{print $2}')"
- name: Update Pangolin release used in UnCoVar
if: ${{ env.LATEST_PANGOLIN != env.CURRENT_PANGOLIN }}
run: |
sed -i 's/${{ env.CURRENT_PANGOLIN }}/${{ env.LATEST_PANGOLIN }}/' workflow/envs/pangolin.yaml
- name: Create Pull Request
if: ${{ env.LATEST_PANGOLIN != env.CURRENT_PANGOLIN }}
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
committer: GitHub <[email protected]>
commit-message: Update pangolin to ${{ env.LATEST_PANGOLIN }}
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: pangolin-update-to-${{ env.LATEST_PANGOLIN }}
delete-branch: true
title: "build: update Pangolin to ${{ env.LATEST_PANGOLIN }}"
body: |
Hey there, a new release of Pangolin is available: [${{ env.LATEST_PANGOLIN }}](https://github.com/cov-lineages/pangolin/releases/tag/v${{ env.LATEST_PANGOLIN }})
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: |
automated pr
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"