Development

You can read our CONTRIBUTING and CODE_OF_CONDUCT guides before star contributing.

Requirements

Install

Install with yarn install.

Testing

Linting

Run MegaLinter locally:

mega-linter-runner -e 'ENABLE=MARKDOWN'

You can use the -e option to select the linters you want to execute.

Build the typescript and package it for distribution yarn build && yarn package.

Run locally

You can run the app locally:

yarn run build && \
INPUT_QUEUE_NAME="queue-name" \
INPUT_ACTION="next-job" \
  node dist/index.js

Where inputs are environment variables with the prefix INPUT_ and the input name in uppercase.

You can run workflows locally with the act app.

Commit conventions

General conventions:

Conventions related to pull requests:

Conventions related to releases:

Update node dependencies

Given everything, the process of dependencies updates would be as follows:

General update (roughly once a week):

If a security alert is warned by dependabot (critical security vulnerability) proceed immediately with the same workflow, but only with the update that patches it using a specific issue.

For not critical updates we update them roughly once a week.

NOTE: be aware of merging dependabot PRs directly using the GitHub interface. In some cases might produce unverified commits. When GitHub cannot sign the rebased commits.

How to create pull requests

In order to contribute you should follow the next steps:

  1. Make sure there is an issue for your contribution. You can pick up one of the already-define issues or create a new issue describing what you want to implement, fix, ...

  2. Create a fork and a new branch following the branch name convention: issue-XXX-short-description-or-issue-title-with-kebab-case-format

  3. Make your changes and commit them using Conventional Commits format. Make sure you sign your commits.

  4. It is very important that all commits have a distribution package of the application. That means you should run always: yarn install && yarn build && yarn package before committing. That sometimes changes the content of the dist folder. Those changes should be included in the commit. That command is going to build the app but it's also going to test it and fix the TypeScript linting.

  5. The target branch for your pull request should be develop. Keep you branch rebased with develop branch.

Recommendations:

[GitHub Status Reporter] Error posting Status for JAVASCRIPTwith standard: 403
GitHub API response: {"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/reference/repos#create-a-commit-status"}
[Text Reporter] Generated TEXT report: /github/workspace/report/linters_logs/SUCCESS-JAVASCRIPT_STANDARD.log

And where to get more info about the linter is using and its configuration.

You can also download the reports as an artifact.

Releases

See commit conventions related to releases.

More info about releases in this discussion.

Publish to a distribution branch

Actions are run from GitHub repos so we will check in the packed dist folder.

Then run ncc and push the results:

yarn package
git add dist
git commit -a -m "prod dependencies"
git push origin releases/v1

Note: We recommend using the --license option for ncc, which will create a license file for all of the production node modules used in your project.

Your action is now published!

See the versioning documentation

Action versioning

After testing, you can create a v1 tag to reference the stable and latest V1 action.

Documentation

We are using MkDocs for this documentation site.

Commands

You might see this error when you try to execute those commands:

$ mkdocs
Command 'mkdocs' not found, but can be installed with:
sudo apt install mkdocs

You can install it with:

pip install mkdocs

Project layout

    mkdocs.yml    # The configuration file.
    docs/
        index.md  # The documentation homepage.
        ...       # Other markdown pages, images and other files.