Skip to content

Commit

Permalink
Added support for importing archives in "Incoming" GitHub Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Feb 12, 2023
1 parent 1f5010a commit eb0d402
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/incoming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,38 @@ on:
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:
publish:
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 "Add $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

0 comments on commit eb0d402

Please sign in to comment.