trigger-event #1
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: Create New Project | |
on: | |
repository_dispatch: | |
types: ["trigger-event"] | |
env: | |
repo: ${{ github.repository }} | |
org: ${{ github.repository_owner }} | |
title: ${{ github.event.client_payload.title }} | |
jobs: | |
create-project: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up GitHub CLI | |
uses: actions/setup-gh-cli@v1 | |
- name: Authenticate GitHub CLI | |
run: gh auth login --with-token < ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub Project and Issues | |
run: | | |
project_url=$(gh project create --owner "$org" --title "$title") | |
gh project link $(basename project_url) | |
for file in issue_template/*.md; do | |
issue_title="$title - ${file%.md}" | |
gh issue -R "$repo" create --title "$issue_title" --body-file "$file" --project "$title" | |
done |