Skip to content

Fixing <h1/>

Fixing <h1/> #22

name: Presentation Issue to PR
on:
issues:
types: [opened, reopened]
jobs:
check-issue-title:
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.check-title.outputs.should-run }}
steps:
- name: Check Issue Title
id: check-title
run: |
echo "Checking issue title..."
if [[ "${{ github.event.issue.title }}" =~ ^\[Presentation\].* ]]; then
echo "::set-output name=should-run::true"
else
echo "::set-output name=should-run::false"
echo "Issue does not start with [Presentation]."
fi
create-pr-for-new-presentation:
needs: check-issue-title
if: needs.check-issue-title.outputs.should-run == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Issue Forms Body Parser
id: parse
uses: zentered/issue-forms-body-parser@v2.0.0
- name: Issue Definitions
id: define
run: |
jsonData='${{ steps.parse.outputs.data }}'
echo "$jsonData"
source shell/deps.sh
makeoutput "$jsonData" title title string
makeoutput "$jsonData" date date date
makeoutput "$jsonData" speaker speaker string
makeoutput "$jsonData" slides-optional slides string
makeoutput "$jsonData" slides-source-optional slidesSource url
- name: Log
run: |
echo "Title: ${{ steps.define.outputs.title }}"
echo "Date: ${{ steps.define.outputs.date }}"
echo "Speaker: ${{ steps.define.outputs.speaker }}"
echo "Slides: ${{ steps.define.outputs.slides }}"
echo "Slides Source: ${{ steps.define.outputs.slidesSource }}"
- name: Append
run: |
source shell/deps.sh
content_file="presentations/${{ steps.define.outputs.date }}-${{ steps.define.outputs.speaker }}.md"
echo "---" >> "./src/content/$content_file"
appendcontent "$content_file" "title" "${{ steps.define.outputs.title }}"
appendcontent "$content_file" "date" "${{ steps.define.outputs.date }}"
appendcontent "$content_file" "speaker" "${{ steps.define.outputs.speaker }}"
appendcontent "$content_file" "slides" "${{ steps.define.outputs.slides }}"
appendcontent "$content_file" "slidesSource" "${{ steps.define.outputs.slidesSource }}"
echo "---" >> "./src/content/$content_file"
echo "" >> "./src/content/$content_file"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: 'New Presentation: ${{ steps.define.outputs.title }} ${{ steps.define.outputs.speaker }} ${{ steps.define.outputs.date }} (#${{ github.event.issue.number }})'
title: 'New Presentation: ${{ steps.define.outputs.title }} ${{ steps.define.outputs.speaker }} ${{ steps.define.outputs.date }} '
body: |
Adds a new presentation based on issue #${{ github.event.issue.number }}.
branch: 'new-presentation-${{ github.run_id }}'