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
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+56-54Lines changed: 56 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,54 +22,48 @@ Thank you for being part of the Telefónica Innovación Digital Open Source Comm
22
22
1.:hammer_and_wrench: Install the dependencies
23
23
24
24
```bash
25
-
npm install
25
+
pnpm install
26
26
```
27
27
28
-
1.:building_construction: Package the TypeScript for distribution
28
+
2.:white_check_mark: Run the unit tests
29
29
30
30
```bash
31
-
npm run package
32
-
```
33
-
34
-
1.:white_check_mark: Run the unit tests
35
-
36
-
```bash
37
-
$ npm run test:unit
31
+
$ pnpm test:unit
38
32
39
33
PASS test/unit/specs/main.spec.ts
40
34
PASS test/unit/specs/index.spec.ts
41
35
...
42
36
43
37
## Test the action locally
44
38
45
-
The [`@github/local-action`](https://github.com/github/local-action) utility
46
-
can be used to test your action locally. It is a simple command-line tool
47
-
that "stubs" (or simulates) the GitHub Actions Toolkit. This way, you can run
48
-
your TypeScript action locally without having to commit and push your changes
49
-
to a repository.
39
+
The action is a Docker container that runs a Node.js script. To test the action locally, you can run the Docker compose file in the root of the repository. This will build the Docker image and run the action in a container.
50
40
51
-
The `local-action` utility can be run in the following ways:
41
+
```bash
42
+
$ docker compose build
43
+
$ docker compose run action
44
+
```
52
45
53
-
- Visual Studio Code Debugger
46
+
> [!CAUTION]
47
+
> The Docker image won't work in some systems due to the usage of Chromium, as in MacOS with M1 processors. In this case, you can [run the Node.js code instead](#test-the-nodejs-code-locally).
54
48
55
-
Make sure to review and, if needed, update
56
-
[`.vscode/launch.json`](./.vscode/launch.json)
49
+
You can provide a `.env` file to set environment variables used by the GitHub Actions Toolkit. For more information, see the example file, [`.env.example`](./.env.example), and the
> The root workspace directory is mounted as a volume in the container in the `/github/workspace` folder. You can set another workspace subdirectory for testing the synchronization locally by setting the `INPUT_CWD` environment variable to the desired directory (e.g. `INPUT_CWD=test-action`).
59
54
60
-
```bash
61
-
# npx local action <action-yaml-path> <entrypoint> <dotenv-file>
62
-
npx local-action . src/main.ts .env
63
-
```
55
+
### Test the Node.js code locally
64
56
65
-
You can provide a `.env` file to the `local-action` CLI to set environment
66
-
variables used by the GitHub Actions Toolkit. For more information, see the example
Apart from running the unit tests, you can also run the Node.js code locally by following these steps:
58
+
59
+
* Modify the `src/action/main.ts` file to change the `BASE_CWD` variable from `/github/workspace` to the desired directory (e.g. `test-action`).
60
+
* Build the action code using the `pnpm build` command.
61
+
* Add your markdown file and configuration files to the desired directory (e.g. `test-action/markdown-confluence-sync.config.js` and `test-action/docs/foo.md`).
62
+
* Run the action code using `node bin/markdown-confluence-sync-action.js`.
69
63
70
64
## E2E tests
71
65
72
-
This project includes end-to-end tests, consisting in a workflow that uses the action to sync the documentation of the project itself to a Confluence page, and then checks if the page was updated correctly.
66
+
This project includes end-to-end tests, consisting in a workflow that uses the action to sync the documentation of the project itself to a Confluence page, and then checks if the page was updated correctly. Once the documentation has been synced, you can run tests using the following command:
73
67
74
68
```bash
75
69
npm run test:e2e
@@ -111,32 +105,40 @@ But we use the __merge commit strategy for merging PRs to the main branch from t
111
105
112
106
# Release process
113
107
114
-
Once the PR is approved and merged into the main branch, a project maintainer can start the release process by tagging the main branch with the corresponding version numbers.
115
-
116
-
This project includes a helper script, [`script/release`](./script/release)
117
-
designed to streamline the process of tagging and pushing new releases for
118
-
GitHub Actions.
119
-
120
-
GitHub Actions allows users to selecta specific version of the action to use,
121
-
based on release tags. This script simplifies this process by performing the
122
-
following steps:
123
-
124
-
1. **Retrieving the latest release tag:** The script starts by fetching the most
125
-
recent SemVer release tag of the current branch, by looking at the local data
126
-
available in your repository.
127
-
1. **Prompting for a new release tag:** The user is then prompted to enter a new
128
-
release tag. To assist with this, the script displays the tag retrieved in
129
-
the previous step, and validates the format of the inputted tag (vX.X.X). The
130
-
user is also reminded to update the version field in package.json.
131
-
1. **Tagging the new release:** The script then tags a new release and syncs the
132
-
separate major tag (e.g. v1, v2) with the new release tag (e.g. v1.0.0,
133
-
v2.1.2). When the user is creating a new major release, the script
134
-
auto-detects this and creates a `releases/v#` branch for the previous major
135
-
version.
136
-
1. **Pushing changes to remote:** Finally, the script pushes the necessary
137
-
commits, tags and branches to the remote repository. From here, you will need
138
-
to create a new release in GitHub so users can easily reference the new tags
139
-
in their workflows.
108
+
Once the PR is approved and __merged into the release branch__, a project maintainer can start the release process by:
109
+
110
+
1. Checking the version number in the `package.json` file and updating it if necessary.
111
+
2. Checking the action version in the `.github/actions/check-and-comment/action.yml` file and updating it if necessary.
112
+
3. Updating the CHANGELOG.md file with the changes in the new version.
113
+
4. Remove the beta tags created for the PR check.
114
+
5. Tagging the release branch with the corresponding version numbers.
115
+
116
+
This project includes a helper script, [`script/release`](./script/release)
117
+
designed to streamline the process of tagging and pushing new releases for
118
+
GitHub Actions.
119
+
120
+
GitHub Actions allows users to select a specific version of the action to use,
121
+
based on release tags. This script simplifies this process by performing the
122
+
following steps:
123
+
124
+
1. **Retrieving the latest release tag:** The script starts by fetching the most
125
+
recent SemVer release tag of the current branch, by looking at the local data
126
+
available in your repository.
127
+
2. **Prompting for a new release tag:** The user is then prompted to enter a new
128
+
release tag. To assist with this, the script displays the tag retrieved in
129
+
the previous step, and validates the format of the inputted tag (vX.X.X). The
130
+
user is also reminded to update the version field in package.json.
131
+
3. **Tagging the new release:** The script then tags a new release and syncs the
132
+
separate major tag (e.g. v1, v2) with the new release tag (e.g. v1.0.0,
133
+
v2.1.2). When the user is creating a new major release, the script
134
+
auto-detects this and creates a `releases/v#` branch for the previous major
135
+
version.
136
+
4. **Pushing changes to remote:** Finally, the script pushes the necessary
137
+
commits, tags and branches to the remote repository. From here, you will need
138
+
to create a new release in GitHub so users can easily reference the new tags
139
+
in their workflows.
140
+
6. Create a new release in GitHub with the tag created in the previous step and the changes in the CHANGELOG.md file.
Copy file name to clipboardExpand all lines: .github/workflows/test-e2e.yml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ jobs:
28
28
with:
29
29
mode: id
30
30
docs-dir: '.'
31
+
confluence-notice-message: 'This page is automatically generated from content in the <a href="https://github.com/Telefonica/markdown-confluence-sync-action" target="_blank">markdown-confluence-sync-action repository</a> Changes made manually will be lost, you should edit this page in Github instead.'
Copy file name to clipboardExpand all lines: CHANGELOG.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
#### Deprecated
12
12
#### Removed
13
13
14
+
## [2.0.1] - 2025-03-18
15
+
16
+
### Changed
17
+
18
+
* chore(deps): Bump @tid-xcut/markdown-confluence-sync from 1.1.0 to 1.1.1 (Fix preprocess hook)
19
+
* docs: Improve release process guide in CONTRIBUTING.md
20
+
21
+
## [2.0.0] - 2025-03-18
22
+
23
+
### Changed
24
+
25
+
* feat(BREAKING CHANGE): Throw an error in case the `cwd` input is absolute, because the action only has access to the repository files
26
+
* chore: Use Docker action instead of Node.js action in order to install Chromium and Puppeteer
27
+
* chore: Use Pnpm instead of NPM
28
+
* chore: Move `dependencies` to `devDependencies`, because in runtime the action uses only the bundled code, and it installs the mermaid dependencies by itself in the Docker image. This is because the `@tid-xcut` libraries are in a private repository, and the action cannot install them in the Docker image. Some fixes are applied to the bundled code to make it work in the Docker image.
29
+
30
+
### Fixed
31
+
32
+
* fix: Generate mermaid diagrams in the Confluence page
33
+
34
+
### Added
35
+
36
+
* docs: Add automation notice to Confluence pages containing the action docs
37
+
* test: Add mermaid diagram to readme.md file, and test that it has been synced to Confluence in E2E tests
0 commit comments