In #97 it was missed to adjust the reusable workflow to pull changes from the forked commit. Instead, now we pull from base repository, which doesn't contain the external contributor's changes.
I've also improved the way we reference the reusable workflow to ensure we're using a trusted reusable workflow that won't change often.
Currently an external contributor can't have the acceptance tests run on their PR because pull_request doesn't give access to the secrets needed for them.
Therefore, in this PR we create a new workflow that is identical to the one for existing acceptance tests, with the following differences:
This workflow can be triggered with the command /ok-to-test sha="<contributor's latest commit sha>" by one of this repo's maintainers.
After the acceptance tests finish, their result will be updated to the PR's list of checks.
This file contains the same acceptance test jobs with the following differences:
- They only run if the `ok-to-test` command triggered the workflow and a sha has been passed.
- They checkout from the external contributor's commit.
Lastly, this workflow contains an extra job which updates the status in the PR based on the jobs executed. The result of a job is the parent result of all the matrix variants executed as part of it.
This workflow is the acceptance tests executed based on the following inputs:
- secret references
- whether the secrets are provided as a step output or environment variables.
In a previous PR we used `branch` syntax to trigger the pipeline when a push on `main` was made. This was a mistake and `branches` is the correct syntax that achieves this.
In Oct 2023, @1password/front-end-style has been rewritten into 3 smaller packages:
- @1password/eslint-config
- @1password/prettier-config
- @1password/stylelint-config
These 3 new packages have the same configurations as the previous package, with the benefits of being up-to-date and better organized. In the case of this GitHub Action, we only need the first two. The last one is dedicated to CSS stylling, which is not used in this action. Therefore, we will replace the deprecated @1password/front-end-style with the following packages:
- @1password/eslint-config
- @1password/prettier-config
* Add lint in workflow
This will check for code formatting, as well as for any ES lint issues.
* Format code
run `npm run check:write`
* Run lint and fix errors
Run `npm run lint` and then fix the errors shown.