multi: Upgrade actions to github actions toolkit #34

Merged
fguisso merged 1 commit from npm into main 2022-06-02 04:54:30 -04:00
fguisso commented 2022-04-30 00:28:11 -04:00 (Migrated from github.com)

Hey ppl! Resolving the conversation in #32 here is the work for changing the Github Action from composite type to javascript type using the Github Actions Toolkit.

Again, this change will help with:

  • Don't use GITHUB_ENV for store configuration(a very bad practice that I generate in the actions projects).
  • We can use different Actions together with the need prefix, all inputs are stored just in runtime inside the action.
  • Github Actions Toolkit give more power than the composite type, which means we can upgrade the Actions with new features that communicate better with the Github Actions API.

Observations:

  • dist directory needs to be stored in github because of how Github Javascript Actions works, see the docs.
  • Every new feature that modifies .js files needs to be built by the script npm run build to generate a new dist files. Maybe we will need some Development README for future contributions.

GOOD NEWS:
I did several tests that you can see here and everything is working well and transparent for users, this latest version of composite action is fully compatible with this new javascript action.

If you agree and review this PR, I can start working in port the another ProjectDiscovery Actions.

Hey ppl! Resolving the conversation in #32 here is the work for changing the Github Action from `composite` type to `javascript` type using the Github Actions Toolkit. Again, this change will help with: - Don't use `GITHUB_ENV` for store configuration(a very bad practice that I generate in the actions projects). - We can use different Actions together with the need prefix, all inputs are stored just in runtime inside the action. - Github Actions Toolkit give more power than the `composite` type, which means we can upgrade the Actions with new features that communicate better with the Github Actions API. Observations: - `dist` directory needs to be stored in github because of how Github Javascript Actions works, see the [docs.](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action) - Every new feature that modifies `.js` files needs to be built by the script `npm run build` to generate a new `dist` files. Maybe we will need some Development README for future contributions. GOOD NEWS: I did several tests that you can see [here](https://github.com/fguisso/projectdiscovery-actions-test/actions) and everything is working well and transparent for users, this latest version of `composite` action is fully compatible with this new `javascript` action. If you agree and review this PR, I can start working in port the another ProjectDiscovery Actions.
fguisso commented 2022-04-30 12:59:52 -04:00 (Migrated from github.com)

I noticed that the github report doest work anymore because a new feature from GITHUB_TOKEN. Now you need to setting the permission type before write your job, see more in github docs.

This PR works fine with this new configuration, see the example:

permissions:
  issues: write
...
    github-token: ${{ secrets.GITHUB_TOKEN }}

Complete example here.

To-Do

  • Update the README.md
I noticed that the github report doest work anymore because a new feature from `GITHUB_TOKEN`. Now you need to setting the permission type before write your job, see more in [github docs](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token). This PR works fine with this new configuration, see the example: ```yaml permissions: issues: write ... github-token: ${{ secrets.GITHUB_TOKEN }} ``` Complete example [here](https://github.com/fguisso/projectdiscovery-actions-test/blob/db82b76577fa20feef7ccb9b166c758e8e657711/.github/workflows/nuclei-github.yml#L6). ## To-Do - Update the README.md
toufik-airane (Migrated from github.com) approved these changes 2022-06-02 03:36:01 -04:00
toufik-airane (Migrated from github.com) left a comment

I thought I had already reviewed it.
Thank you for the awesome work! 🚜

I thought I had already reviewed it. Thank you for the awesome work! 🚜
ehsandeep (Migrated from github.com) approved these changes 2022-06-02 04:54:11 -04:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
projectdiscovery/nuclei-action!34
No description provided.