Enhance GHA: "Skills Activity" use Skills Issue directory
- Dominant language
- JavaScript
- Stars
- 363
- Forks
- 872
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 18
Description
### Overview
We need to reduce the number of unnecessary GitHub API calls that the "Member Activity Trigger" workflow makes when posting to a user's Skills Issue by providing a user directory.
### Action Items
- [x] Locate the most recent [skillsIssueNums.csv](https://drive.google.com/drive/u/0/folders/1M1DBKcrtygrkURhi1KtmqjkTMQCcBzY5) file on the Google Drive. Note that it lists each member's GitHub handle, Skills Issue number, Node Id (used with GraphQL), id used with (REST API) and other info.
- [x] Now review `github-actions/activity-trigger/post-to-skills-issue.js`. Note that the workflow uses a GraphQL `querySkillsIssue()` to search for a user's (i.e. `eventActor`) Skills Issue, and then REST API calls `github.request('GET...)` and `(PATCH...)` to search for the "Activity History" comment, and then update it with the new info.
- [x] Instead, we need the workflow to first search the previously mentioned file to retrieve the user's Skills Issue number and the id that will be used for patching, and if these are found- skip the other queries.
- [x] If not found, the workflow should perform the searches **_and save this information to the file._**
There are many ways this could be done, but however this is done the functions should follow the same architecture HfLA is already using. Some suggestions:
- [x] Save the Skills Issue directory to the `github-actions/utils/_data` folder, and convert the directory to a JSON.
- [x] Create a new module in `utils` that will lookup in the directory and return the information.
- [ ] Might want to pull the previously mentioned searches out of `post-to-skills-issue.js` and into a module that also will update the directory when needed.
### Resources/Instructions
- [GitHub GraphQL Explorer](https://docs.github.com/en/enterprise-server@3.12/graphql/overview/explorer)
- [GitHub GraphQL API](https://github.com/octokit/octokit.js?tab=readme-ov-file#graphql-api-queries)
- Refer to https://github.com/hackforla/website/issues/6537#issuecomment-2041147335, especially Tips 6, 7, and 8, if you have not already created you personal environment for testing.
- [How to Test GitHub Actions](https://drive.google.com/drive/u/0/folders/1MPY9CKcfKKN7hpDCG46ARrRzRSM8d8OA)
- [Additional Notes for GitHub Actions](https://docs.google.com/document/d/1frtvr5twBa_3yRGCG0divhlOMW8dPJxT/edit)
Contributor guide
Assessment
This issue has not been assessed yet.