New Project Configuration - [NC Transit Equity Mode Shift Program Evaluation] #37
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: Convert Issues to JSON Data | |
on: | |
issues: | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues | |
types: | |
- opened | |
- edited | |
- reopened | |
- labeled | |
jobs: | |
convert_to_config: | |
if: contains( github.event.issue.title, 'New Project Configuration' ) | |
runs-on: ubuntu-latest | |
steps: | |
# This step checks out a copy of your repository. | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: install dependencies | |
shell: bash -l {0} | |
run: | | |
npm install js-yaml | |
npm i @actions/core | |
npm i @actions/github | |
# This step references the directory that contains the action. | |
- name: Use local convertIssue action | |
uses: ./.github/actions/convertIssue | |
with: | |
# This controls where the JSON files are generated | |
folder: "configs/" | |
# This tells the action which GitHub Issue Form template file to use | |
issue-template: "add-new-config.yml" | |
# This controls which property we use to key the file name | |
hash-property-name: "url_abbreviation" | |
- name: Commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add configs/ | |
git commit -m "Creating or updating file from form in issue #${{ env.IssueNumber }}" | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
add-paths: | | |
configs/ | |
commit-message: Create or update a new config file | |
signoff: false | |
branch: new-config-#${{ env.IssueNumber }} | |
delete-branch: false | |
title: '[Config #${{ env.IssueNumber }}] create new file' | |
body: | | |
Adding a new config file | |
- Initialized by creating or updating the coressponding issue | |
- Auto-generated by [create-pull-request][1] | |
[1]: https://github.com/peter-evans/create-pull-request | |
draft: false |