update-event #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update datasources | |
on: | |
repository_dispatch: | |
types: [update-event] | |
workflow_dispatch: | |
jobs: | |
update-version: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Echo client-payload values | |
run: | | |
echo "Ref: ${{ github.event.client_payload.ref }}" | |
echo "SHA: ${{ github.event.client_payload.sha }}" | |
echo "Datasource: ${{ github.event.client_payload.datasource }}" | |
echo "Processed data: ${{ github.event.client_payload.processed_data }}" | |
echo "Release number: ${{ github.event.client_payload.version }}" | |
echo "Date: ${{ github.event.client_payload.date }}" | |
- name: Update data files | |
env: | |
PAT_TOKEN: ${{ secrets.PAT }} | |
run: | | |
cd inst/apps/processed_mapping_files | |
artifact=$(echo ${{ github.event.client_payload.processed_data }} | grep -oP '[^/]*$') | |
curl -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -L -o processed_data.zip "https://api.github.com/repos/sec2pri/mapping_preprocessing/actions/artifacts/$artifact/zip" | |
unzip processed_data.zip | |
rm -f processed_data.zip | |
ls | |
cd ../../ | |
- name: Commit new data files | |
env: | |
token: ${{ secrets.PAT }} | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "OmicsFixID bot" | |
git add --all | |
git status | |
git commit -m "Updated data" -m "Artifact URL: ${{ github.event.client_payload.datasource }}" | |
git push | |
#TODO - name: Update dataSourceVersion | |