How to use github projects - a getting started video -
https://www.youtube.com/watch?v=oPQgFxHcjAw
Opened a private repo with issues, and with ChatGPT's help, linked it to a project. (Projects --> New Project in the github web UI for that repo). Automation to create a new issue worked after some tweaking - the github actions yml is copy-pasted below:
name: Instantiate Planetarium Show Task
on:
workflow_dispatch:
inputs:
show_title:
description: 'Title of the Planetarium Show'
required: true
deadline:
description: 'Deadline'
required: false
permissions:
issues: write
contents: read
jobs:
create_task_issue:
runs-on: ubuntu-latest
steps:
- name: Build issue content
run: |
echo "## Show Details" > issue.md
echo " " >> issue.md
echo "**Show Title:** " >> issue.md
echo "${{ github.event.inputs.show_title }}" >> issue.md
echo "" >> issue.md
echo "**Deadline:** " >> issue.md
echo "${{ github.event.inputs.deadline }}" >> issue.md
echo "" >> issue.md
echo "## Steps" >> issue.md
echo "" >> issue.md
echo "- [ ] Create script" >> issue.md
echo "- [ ] Create Hindi translation" >> issue.md
echo "- [ ] Create Telugu translation" >> issue.md
echo "- [ ] Review Hindi translation" >> issue.md
echo "- [ ] Review Telugu translation" >> issue.md
echo "- [ ] Record Hindi VO" >> issue.md
echo "- [ ] Record Telugu VO" >> issue.md
echo "- [ ] Edit Hindi VO" >> issue.md
echo "- [ ] Edit Telugu VO" >> issue.md
echo "- [ ] Warp ready for our theatre" >> issue.md
echo "- [ ] Eng-Hin-Tel audio" >> issue.md
echo "- [ ] Final audio mix" >> issue.md
echo "- [ ] Save backups" >> issue.md
echo "- [ ] Post on website" >> issue.md
echo "" >> issue.md
echo "---" >> issue.md
echo "" >> issue.md
echo "" >> issue.md
- name: Create issue from template
uses: peter-evans/create-issue-from-file@v4
with:
title: "[Show] ${{ github.event.inputs.show_title }}"
content-filepath: issue.md
token: ${{ secrets.GITHUB_TOKEN }}
labels: show,task
This script had to be re-written due to ChatGPT repeatedly using heredoc syntax which would clash with github's yml. I had to explicitly ask it to "Please use echo >> on each line, and no heredoc."
One more automation script to automatically move the items in the project from "TODO" to "In Progress" when any of the checkboxes above were clicked, failed. ChatGPT usually fails when the documentation is not complete and / or there are conflicting earlier documentation pages, as in this case. It would repeatedly suggest using
permissions: issues: write projects: write
when actually such a permission is no longer accepted by Github - it was part of "classic projects" - https://docs.github.com/en/enterprise-server@3.16/issues/planning-and-tracking-with-projects/creating-projects/migrating-from-projects-classic.
Apparently with projectsV2, the REST api does not work, only GraphQL API works. And it needs a classic personal access token to work. And the code generated by ChatGPT had errors which I could not get it to fix after multiple iterations over multiple days, so I just left updates to be done manually by clicking on the drop-down seen in the linked project for each issue. I could probably read the GraphQL API documentation and try again, but right now, not motivated to do so.
No comments:
Post a Comment