WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
254 stars 202 forks source link

Refactor weekly update script to run as a `github-script` action #3448

Open dhruvkb opened 11 months ago

dhruvkb commented 11 months ago

Description

The weekly update script last_week_tonight.mjs runs as a standalone Node.js script. It is the last remaining standalone script in the JS based automations. Converting it to a actions/github-script based job would bring the following improvements:

This is closely related to #3445 as they both deal with improvements to the same workflow.

danielbmasud commented 11 months ago

Hi @dhruvkb, I can work on this!

dhruvkb commented 11 months ago

Sure, please do! I'll assign this issue to you.

danielbmasud commented 11 months ago

Is .github/workflows/weekly_updates.yml not already running a github action based job?

dhruvkb commented 11 months ago

It's currently invoked as a Node.js script. This means that to run this, we first need to set up up Node.js, install dependencies and then finally invoke the script using a run step.

https://github.com/WordPress/openverse/blob/b004dc620897d832fefa01c97a4fe16206adc713/.github/workflows/weekly_updates.yml#L28-L29

We want to update the script so that we can invoke it from actions/github-script. This generally involves

For an example, see the issue_automations.yml workflow. It does not need a setup step and we get access to an authenticated Octokit instance (octokit) and the GitHub actions toolkit (core) for free.

https://github.com/WordPress/openverse/blob/b004dc620897d832fefa01c97a4fe16206adc713/.github/workflows/issue_automations.yml#L25-L34

You can also refer to the actual script automations/js/src/project_automation/issues.mjs that contains the aforementioned main() function.

https://github.com/WordPress/openverse/blob/b004dc620897d832fefa01c97a4fe16206adc713/automations/js/src/project_automation/issues.mjs#L29

zackkrida commented 8 months ago

Hi @danielbmasud, I've unassigned you from this issue. If you would like to work on it again in the future please let us know. Thanks!