Asana / comment-on-task-github-action

26 stars 15 forks source link

Fix actions deprecation warnings: Update runtime node version to 16, bump @actions/core to 1.10.0 #9

Closed stefafafan closed 1 year ago

stefafafan commented 1 year ago

related: https://github.com/Asana/create-app-attachment-github-action/issues/16

Update runtime node version to 16

When using this action, GitHub warns users to update to Node.js 16. So I went ahead and updated it ( https://github.com/Asana/comment-on-task-github-action/pull/9/commits/86184f7ff6fe27750067cbcbfe3e9a9e367cf331 )

Node 12 has been out of support since April 2022, as a result we have started the deprecation process of Node 12 for GitHub Actions. We plan to migrate all actions to run on Node16 by Summer 2023. GitHub Actions: All Actions will begin running on Node16 instead of Node12 | GitHub Changelog

Locally, using Node.js 16 the test runs successfully so I think it should be fine?

```sh $ node --version v16.18.0 $ npm run test > comment-on-task-github-action@1.0.0 test > jest PASS src/utils/index.test.ts ✓ getProjectsFromInput should return array of project gids (3 ms) validateTrigger ✓ should throw an error if wrong eventType was provided (6 ms) ✓ should not throw an error if wrong eventType was provided validateProjectLists ✓ should throw an error if both projects lists are not empty (1 ms) ✓ should not throw an error if only one projects list is not empty Test Suites: 1 passed, 1 total Tests: 5 passed, 5 total Snapshots: 0 total Time: 1.611 s, estimated 2 s Ran all test suites. ```

Update @actions/core to 1.10.0

Here is another warning I get.

The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

According to the blog, updating to @actions/core to 1.10.0 fixes this so I bumped it (https://github.com/Asana/comment-on-task-github-action/pull/9/commits/6db0f9d063c7ce49d33ac496d9635838b3ab466b , https://github.com/Asana/comment-on-task-github-action/pull/9/commits/1f20966d72428898ea1a3eef9d15c496a6f1ba61 ).


Also, regardless of this, it seems that npm run lint gives you a diff in src/constants/errors.ts so I committed that as well ( https://github.com/Asana/comment-on-task-github-action/pull/9/commits/07c86116b0b7cbea4caa0f339b6a8182a134d379 ).