You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This GitHub action is fully developed in Typescript and can be run locally via npm or right from the browser using GitHub Codespace.
725
+
This GitHub action is fully developed in Typescript and can be run locally via `npm` or right from the browser using `GitHub Codespace`.
726
726
727
727
[](https://codespaces.new/mikepenz/release-changelog-builder-action)
728
728
729
729
Doing so is a great way to test the action and/or your custom configurations locally, without the need to push and re-run GitHub actions over and over again.
730
730
731
731
To run locally, or to access private repositories (GitHub Codespaces has automatic access to public repos with the default token), you will require to provide a valid `GITHUB_TOKEN` with read only permissions to access the repositories you want to run this action towards. (See more details in [Token Permission](#Token-Permission))
732
732
733
+
To test your own configuration and usecase, the project contains a [__tests__/demo/demo.test.ts](https://github.com/mikepenz/release-changelog-builder-action/blob/develop/__tests__/demo/demo.test.ts) file, modify this one to your needs. (e.g. change repo, change token, change settings, ...), and then run it via:
734
+
735
+
```bash
736
+
npm test -- demo.test.ts
737
+
```
738
+
739
+
<details><summary><b>Debugging with Breakpoints</b></summary>
740
+
<p>
741
+
742
+
One major benefit of setting up a custom test is that it will allow you to use javascripts full debugging support, including the option of breakpoints via (for example) Visual Code.
743
+
744
+
From GitHub codespaces, open the terminal panel -> Click the small arrow down beside `+` and pick `JavaScript Debug Terminal` (make sure to export the token again). Now execute the test with this terminal. (This is very similar to local Visual Code environments).
745
+
746
+
</p>
747
+
</details>
748
+
749
+
<details><summary><b>Run common tests</b></summary>
750
+
<p>
751
+
752
+
To run the common tests of the action, you require to export a valid github token.
753
+
733
754
```
734
755
# Export the token in the CLI you use to execute.
735
756
export GITHUB_TOKEN=your_read_only_github_token
736
757
```
737
758
738
-
Afterwards it is possible to run the tests included in the project:
759
+
Afterwards it is possible to run any test included in the project:
739
760
740
761
```bash
741
762
npm test -- main.test.ts # modify the file name to run other testcases
742
763
```
743
764
744
-
To test your own configuration, it's adviced to create a new `__tests__/custom.test.ts` file, modify it to your needs (e.g. change repo, change token, change settings, ...), and then run it via `npm test -- custom.test.ts`
One major benefit of setting up a custom test is that it will allow you to use javascripts full debugging support, including the option of breakpoints via (for example) Visual Code.
791
-
792
-
From GitHub codespaces, open the terminal panel -> Click the small arrow down beside `+` and pick `JavaScript Debug Terminal` (make sure to export the token again). Now execute the test with this terminal. (This is very similar to local Visual Code environments).
793
-
794
768
## Token Permission
795
769
796
770
Permissions depend on the specific usecase, however this action only requires `read-only` permissions as it will not make modifications to the repository.
0 commit comments