Update EBI index #14
Workflow file for this run
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 EBI index | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
update_ebi_index: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Store today date for further use | |
id: today | |
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
with: | |
ref: develop | |
- name: Run python script to get new dates | |
id: index_updater | |
run: echo "status=$(python EBI/update_index_json.py --release ${{ github.ref_name }} --release-date ${{ steps.today.outputs.date }})" >> $GITHUB_OUTPUT | |
- name: Commit new change and push to develop branch | |
if: ${{ steps.index_updater.outputs.status == 'updated' }} | |
run: | | |
git config --local user.name ${{ github.actor }} | |
git config --local user.email "${{ github.actor }}@users.noreply.github.com" | |
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git add EBI/pathogens_portal_index.json | |
git commit -m "EBI index updated" | |
git push origin develop | |
- name: Make pull request to main branch | |
if: ${{ steps.index_updater.outputs.status == 'updated' }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh pr create --base main --head develop --title "Update EBI index - ${{ steps.today.outputs.date }}" --body "Version `${{ github.ref_name }}` is released, update index file accordingly." |