Fetch the ensembl VEP image version and make a PR on new version #47
This file contains hidden or 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: Fetch the ensembl VEP image version and make a PR on new version | |
| # NOTE! | |
| # This workflow has to be tested on the next ensembl VEP image release | |
| # This workflow will attempt to seek the latest version of the ensembl VEP image | |
| # and create a PR to update the version in the Dockerfile. | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * 0' # every Sunday at midnight | |
| jobs: | |
| fetch-version: | |
| name: Fetch the ensembl VEP image version | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get the latest version of the ensembl VEP image | |
| id: get-version | |
| shell: bash | |
| run: | | |
| echo "Fetching the latest version of the ensembl VEP image" | |
| LATEST_VERSION=$(make latest-vep-version) | |
| echo "LATEST_VERSION=${LATEST_VERSION}" >> $GITHUB_ENV | |
| echo "Latest version is $LATEST_VERSION" | |
| echo "Getting the current version from the Makefile" | |
| CURRENT_VERSION=$(make version) | |
| echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV | |
| echo "Current version is $CURRENT_VERSION" | |
| - name: Configure git | |
| if: ${{ env.LATEST_VERSION != env.CURRENT_VERSION }} | |
| id: configure-git | |
| shell: bash | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Update vep docker base image version | |
| if: ${{ env.LATEST_VERSION != env.CURRENT_VERSION }} | |
| id: update-version | |
| shell: bash | |
| run: | | |
| echo "Creating a PR to update the vep version" | |
| # if branch exists, remove previous branch update-vep-version | |
| git branch -D update-vep-version || echo "Branch update-vep-version does not exist" | |
| git push -D origin update-vep-version || echo "Branch update-vep-version does not exist on remote" | |
| # Recreate the branch | |
| git checkout -b update-vep-version | |
| make update | |
| git add Dockerfile | |
| git commit -m "feat: update the ensembl VEP image version to ${{ env.LATEST_VERSION }}" | |
| git push --force --set-upstream origin update-vep-version | |
| - name: Create a PR | |
| if: ${{ env.LATEST_VERSION != env.CURRENT_VERSION }} | |
| id: create-pr | |
| shell: bash | |
| run: | | |
| echo "Creating a PR to update the vep version" | |
| gh pr create --base main --head update-vep-version --title "build(version): update the ensembl VEP image version to ${{ env.LATEST_VERSION }}" --body "This PR updates the ensembl VEP image version to ${{ env.LATEST_VERSION }}. The current version is ${{ env.CURRENT_VERSION }}." | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} |