Skip to content

Commit

Permalink
Merge pull request #134 from adknowledgeportal/schematic-221-upload-m…
Browse files Browse the repository at this point in the history
…anifests-to-synapse-action

[Schematic-221] Upload Metadata Templates to Synapse from Github Action
  • Loading branch information
GiaJordan authored Dec 18, 2024
2 parents f571560 + 78ce78c commit 0981a9d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/generate-current-manifests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ on:

jobs:
generate:
name: generate-manifests
name: generate-and-upload-manifests
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SCHEMATIC_SERVICE_ACCOUNT_CREDS: ${{ secrets.SCHEMATIC_SERVICE_ACCOUNT_CREDS }}
SYNAPSE_AUTH_TOKEN: ${{ secrets.SYNAPSE_TOKEN_DPE }}
SYNAPSE_UPLOAD_FOLDER_ID: syn25878249

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -55,3 +57,7 @@ jobs:
reviewers: $$ {github.actor }}
draft: false
delete-branch: true

- name: Upload all manifests
working-directory: current-excel-manifests
run: ../tests/upload_templates.sh
18 changes: 18 additions & 0 deletions tests/upload_templates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# upload metadata templates to synapse
# if running locally set SYNAPSE_AUTH_TOKEN in your environment

set -e
shopt -s extglob

echo Uploading manifests to "${SYNAPSE_UPLOAD_FOLDER_ID}"

MANIFESTS=("$PWD"/*.@(xlsx|xls))

for MANIFEST in ${MANIFESTS[@]};
do
echo "Uploading $MANIFEST"
synapse store --parentId "${SYNAPSE_UPLOAD_FOLDER_ID}" --noForceVersion "$MANIFEST"
done

echo "✓ Done!"

0 comments on commit 0981a9d

Please sign in to comment.