-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (48 loc) · 1.45 KB
/
update_registry.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
name: Update Registry
on:
push:
branches:
- main
jobs:
update_registry:
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v2
with:
ref: 'main'
- name: Install dependencies
run: |
python -m pip install pip --upgrade
python -m pip install pooch
- name: Re-Create Registry
shell: bash
run: python create_registry.py
- name: Check for changes
id: git-status
run: |
git status --porcelain > changes.txt
if [ ! -s changes.txt ]; then
echo "::set-output name=commit_needed::false"
else
echo "::set-output name=commit_needed::true"
fi
shell: bash
- name: Commit changes
if: steps.git-status.outputs.commit_needed == 'true'
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '<${{ github.actor }}@users.noreply.github.com>'
git add registry.txt
git commit --allow-empty -m "Update Registry.txt"
git push origin update-registry
- name: Create pull request
if: steps.git-status.outputs.commit_needed == 'true'
uses: peter-evans/create-pull-request@v3
with:
branch: update-registry
commit-message: Update Registry.txt
title: Update Registry.txt
body: |
This pull request updates the registry.txt file.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}