new org: 0No Co #22
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: Awesome Builder 🤖 | |
on: | |
issues: | |
types: [labeled] | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
awesome-builder: | |
runs-on: ubuntu-latest | |
if: github.event.label.name == 'this is awesome' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Parse issue body | |
id: parse | |
uses: zentered/[email protected] | |
with: | |
body: ${{ github.event.issue.body }} | |
- uses: actions/github-script@v6 | |
id: js | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const script = require('./scripts/awesome-parser.js') | |
return script({ github, context, core, mkdownData: ${{ steps.parse.outputs.data }} }) | |
- name: Populate environment variables | |
run: | | |
echo "org-id=${{ fromJSON(steps.js.outputs.result).orgId }}" >> $GITHUB_ENV | |
echo "org-name=${{ fromJSON(steps.js.outputs.result).orgName }}" >> $GITHUB_ENV | |
echo "org-description=${{ fromJSON(steps.js.outputs.result).orgDescription }}" >> $GITHUB_ENV | |
echo "org-category=${{ fromJSON(steps.js.outputs.result).orgCategory }}" >> $GITHUB_ENV | |
echo "org-url=${{ fromJSON(steps.js.outputs.result).orgUrl }}" >> $GITHUB_ENV | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: "add ${{ env.org-id }}" | |
title: "add(org): ${{ env.org-id }}" | |
branch: "add/${{ env.org-id }}" | |
labels: new org 🚀 | |
delete-branch: true | |
body: | | |
Adds [${{ env.org-name }}](https://github.com/${{ env.org-id }}) to the **${{ env.org-category }}** category. | |
This pull request resolves #${{ github.event.issue.number }} ✨ | |
reviewers: | | |
swand0g | |
eric-hc |