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 CSV data | |
on: | |
issues: | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues | |
types: | |
- reopened | |
- labeled | |
jobs: | |
update_library: | |
runs-on: ubuntu-latest | |
name: Append to the evilometer CSV | |
# only continue if issue has "new-score" label | |
if: contains( github.event.issue.labels.*.name, 'new-score') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: stefanbuck/github-issue-parser@v3 | |
id: issue-parser | |
with: | |
template-path: .github/ISSUE_TEMPLATE/log-evilometer-score.yml | |
- uses: cjlm/[email protected] | |
with: | |
path: src/_data/evilometer-data.csv | |
columns: no,chris,james,michael,guest,man | |
'no': ${{ steps.issue-parser.outputs.issueparser_episode }} | |
'chris': ${{ steps.issue-parser.outputs.issueparser_chris }} | |
'james': ${{ steps.issue-parser.outputs.issueparser_james }} | |
'michael': ${{ steps.issue-parser.outputs.issueparser_michael }} | |
'guest': ${{ steps.issue-parser.outputs.issueparser_guest }} | |
'man': ${{ steps.issue-parser.outputs.issueparser_man }} | |
- name: Commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add * | |
git commit -m "Added evilometer scores for episode ${{ steps.issue-parser.outputs.issueparser_episode }}" | |
git push | |
- name: Close issue | |
uses: peter-evans/close-issue@v1 | |
with: | |
issue-number: '${{ github.event.issue.number }}' | |
comment: 'Thank you! Your data file has been added!' |