-
Notifications
You must be signed in to change notification settings - Fork 15
43 lines (38 loc) · 1.25 KB
/
incoming.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
# Merge an incoming feed into the repository
name: Incoming
on:
workflow_dispatch:
inputs:
feed_url:
required: true
description: URL of feed to merge in
archive_url:
required: false
description: URL of archive to add to archives.db
jobs:
incoming:
runs-on: ubuntu-latest
steps:
- name: Set up directory structure
uses: 0install/apps/.github/actions/setup@master
- name: Download feed
run: curl -sSfL ${{inputs.feed_url}} -o incoming/feed.xml
- name: Download archive
if: inputs.archive_url
run: |
archive_name=$(basename ${{inputs.archive_url}})
curl -sSfL ${{inputs.archive_url}} -o incoming/$archive_name
archive_hash=($(sha1sum incoming/$archive_name))
cd public
echo "$archive_name $archive_hash ${{inputs.archive_url}}" >> archives.db
git add archives.db
git commit -m "Added $archive_name to archives.db"
- name: Run 0repo
uses: 0install/apps/.github/actions/0repo@master
with:
gpg_key: ${{secrets.GPG_KEY}}
- name: Push public
if: inputs.archive_url
run: cd public; git push
- name: Push feeds
run: cd feeds; git push