Skip to content

Add theme(s) to RSS Feed Tailwind Setup #37

Add theme(s) to RSS Feed Tailwind Setup

Add theme(s) to RSS Feed Tailwind Setup #37

name: Speaker 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 }}" =~ ^\[Speaker\].* ]]; then
echo "::set-output name=should-run::true"
else
echo "::set-output name=should-run::false"
echo "Issue does not start with [Speaker]."
fi
create-pr-for-new-speaker:
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 }}'
source shell/deps.sh
makeoutput "$jsonData" name name string
makeoutput "$jsonData" git-hub-username gitHubUsername username
makeoutput "$jsonData" linked-in-profile-url linkedInProfileURL url
makeoutput "$jsonData" website website url
makeoutput "$jsonData" profile-image profileImage url
- name: Log
run: |
echo "Name: ${{ steps.define.outputs.name }}"
echo "GitHub Username: ${{ steps.define.outputs.gitHubUsername }}"
echo "LinkedIn Profile URL: ${{ steps.define.outputs.linkedInProfileURL }}"
echo "Website: ${{ steps.define.outputs.website }}"
echo "Profile Image: ${{ steps.define.outputs.profileImage }}"
- name: Append
run: |
source shell/deps.sh
slug=$(echo '${{ steps.define.outputs.name }}' | tr '[:upper:]' '[:lower:]' | sed -e 's/[^a-zA-Z0-9]/-/g' -e 's/--*/-/g')
echo "$slug"
content_file="speakers/$slug.md"
echo "$content_file"
echo "---" >> "./src/content/$content_file"
appendcontent "$content_file" "githubUsername" "${{ steps.define.outputs.githubUsername }}"
appendcontent "$content_file" "linkedInProfileURL" "${{ steps.define.outputs.linkedInProfileURL }}"
appendcontent "$content_file" "profileImage" "${{ steps.define.outputs.profileImage }}"
appendcontent "$content_file" "name" "${{ steps.define.outputs.name }}"
appendcontent "$content_file" "website" "${{ steps.define.outputs.website }}"
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 Speaker Submission: ${{ steps.define.outputs.name }} (#${{ github.event.issue.number }})'
title: 'New Speaker Submission: ${{ steps.define.outputs.name }}'
body: |
Adds a new speaker based on issue #${{ github.event.issue.number }}.
branch: 'new-speaker-${{ github.run_id }}'