Skip to content

create_summary

create_summary #54

name: create_summary
on:
workflow_dispatch:
inputs:
version:
description: 'Version of resources summary. DEFAULT: retrieve latest version from "resources/MOTBX_version.yaml". ALTERNATIVE: specify a new version; this will update the latest version specified in "resources/MOTBX_version.yaml".'
required: true
default: 'latest'
type: string
permissions:
contents: write
pull-requests: write
jobs:
create_summary:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniforge-variant: Mambaforge
channels: conda-forge
python-version: '3.11'
activate-environment: motbxtools_min
environment-file: envs/motbxtools_min.yml
use-mamba: true
- name: Activate conda environment and install local motbxtools Python library
run: |
conda activate motbxtools_min
python -m pip install -e .
- name: Execute Python script to create resources summary
run: |
python src/motbxtools/utils/summarise_resources.py ${{github.event.inputs.version}}
- name: Read resourceTags yaml file
id: resourcetags
uses: jbutcher5/read-yaml@1.6
with:
file: './resources/summary/resourceTags.yaml'
key-path: '["resourceTags"]'
- name: Update tags option in issue template
uses: ShaMan123/gha-form-dropdown-options@v2.0.3
with:
form: .github/ISSUE_TEMPLATE/01-new-resource-request.yml
dropdown: existingtags
options: "${{ steps.resourcetags.outputs.data }}"
dry_run: no-push
- name: Commit changes and create pull request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '[create_summary] automated MOTBX resources summary'
title: 'Changes created by "create_summary" action'
body: 'Automated changes by [create_summary](https://github.com/EATRIS/motbx/blob/main/.github/workflows/create_summary.yml) GitHub action'
branch: create-pull-request/resource_summary
add-paths: |
resources/summary/*
resources/MOTBX_version.yaml