register-command #63
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: Process registration | |
on: | |
repository_dispatch: | |
types: [register-command] | |
concurrency: 'main' | |
jobs: | |
add_id: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
issues: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Setup Python | |
uses: actions/setup-python@v5.2.0 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r scripts/requirements.txt | |
cd scripts; pip install -e . --no-deps | |
- name: check labels | |
id: label | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
table=`python scripts/labels.py /repos/WCRP-CORDEX/cordex-cmip6-cv/issues/${{ github.event.client_payload.github.payload.issue.number }}` | |
echo $table | |
echo "table=$table" >> $GITHUB_OUTPUT | |
- uses: stefanbuck/github-issue-parser@v3 | |
id: issue-parser | |
with: | |
template-path: .github/ISSUE_TEMPLATE/${{ steps.label.outputs.table }}.yaml | |
issue-body: ${{ github.event.client_payload.github.payload.issue.body }} | |
- name: update table | |
id: update | |
run: | | |
id_added=`python scripts/update-${{ steps.label.outputs.table }}.py '${{ steps.issue-parser.outputs.jsonString }}'` | |
python scripts/create-html-datatables.py | |
echo $id_added | |
echo "id_added=$id_added" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
title: add ${{ steps.update.outputs.id_added }} | |
commit-message: add-${{ steps.update.outputs.id_added }} | |
branch: add-${{ steps.update.outputs.id_added }} | |
body: | | |
Closes #${{ github.event.client_payload.github.payload.issue.number }} | |
Request to add ${{ steps.update.outputs.id_added }} | |
delete-branch: true |