[Pitch]: Label Augmented Modality Agnostic Registration (LAMAR) #13
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: Build Project Pitch | |
on: | |
issues: | |
types: [labeled] | |
jobs: | |
compile-form: | |
if: contains(github.event.issue.labels.*.name, 'approved') && | |
contains(join(github.event.issue.labels.*.name, ', '), 'year/') && | |
contains(github.event.issue.labels.*.name, 'pitch') && | |
! contains(github.event.issue.labels.*.name, 'error') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Parse issue | |
id: parse | |
uses: onmax/[email protected] | |
with: | |
issue_number: ${{ github.event.issue.number }} | |
- name: Set year label | |
id: get_year | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { default: script } = await import('${{ github.workspace }}/actions/get-year.mjs') | |
return await script({github, context}) | |
result-encoding: string | |
- name: Parse organizers | |
run: > | |
echo "organizers=$( | |
echo "${{ fromJson(steps.parse.outputs.payload)['Project Leads']}}" | | |
sed -E 's/([^(]+)\s\(\s*@?([a-zA-Z0-9\-]+)\s*\)/{"name": "\1", "github": "\2"}/' | | |
paste -d',' -s | | |
sed -E 's/^(.*)$/[\1]/' | |
)" >> "$GITHUB_ENV" | |
- name: Add data to config | |
uses: mikefarah/yq@master | |
env: | |
DESCRIPTION: ${{ toJson(fromJson(steps.parse.outputs.payload)['Description']) }} | |
TITLE: ${{ toJson(fromJson(steps.parse.outputs.payload)['Title']) }} | |
URL: ${{ toJson(fromJson(steps.parse.outputs.payload)['Project url']) }} | |
with: | |
cmd: > | |
yq -i '.projects['${{ steps.get_year.outputs.result }}'] += [ | |
{ | |
"title": '"$TITLE"', | |
"description": '"$DESCRIPTION"', | |
'"$([[ "$URL" != '"_No response_"' ]] && echo '"url": '"$URL"',')"' | |
"organizers": '"$organizers"' | |
} | |
]' config.yaml | |
- name: Format yaml output | |
uses: actionsx/prettier@v2 | |
with: | |
args: --no-config --single-quote --write config.yaml | |
- name: Create PR | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: > | |
Add Project: ${{ fromJson(steps.parse.outputs.payload)['Title']}} | |
branch: pitch/${{ github.event.issue.number }} | |
title: > | |
Add Project: ${{ fromJson(steps.parse.outputs.payload)['Title']}} |