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: README.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,25 @@ GitHub Action that handles automated update of dependencies in package.json betw
15
15
16
16
## Why I Created This Action?
17
17
18
-
//TODO
18
+
GitHub Action that handles automated update of dependencies in package.json between projects from the same GitHub organization.
19
+
20
+
The main goal was to automate bump of dependencies between packages from the same organization. You might have several projects depending on each other, and your option to efficiently work with them should not only be a monorepo. In my opinion, people reach for monorepo to quickly, letting themselves to solve one complex problem by introducing another one.
21
+
22
+
You cannot apply monorepo everywhere, sometimes it doesn't make sense, and you still have some dependencies that you need to bump manually. This action doesn't have such a problem.
23
+
24
+
## How It Works?
25
+
26
+
tl;dr To find dependent projects, GitHub Search is utilized.
27
+
28
+
1. You run this action in package `@myorg/test`
29
+
1. After releasing `@myorg/test`, you want latest version of the package to be bumped in other packages in your organization/user called `myorg`
30
+
1. The following search is performed `"@myorg/test" user:myorg in:file filename:package.json`
31
+
1. Search is not perfect, quotations from `"@myorg/test"` are ignored and result can also contain repositories that have only `@myorg/test-sdk` as dependency
32
+
1. All found repositories are cloned (except of `@myorg/test`)
33
+
1. Action verifies if you really have `@myorg/test` in dependencies or devDependencies
34
+
1. Now the rest, bumping + pushing + creating a pull request
35
+
36
+
Approach with using GitHub search has only one disadvantage, bumping will not work in forks, as forks do not show up in search results. It is still better than cloning all repositories from your organization.
19
37
20
38
## Action Flow
21
39
@@ -48,11 +66,4 @@ repos_to_ignore | Comma-separated list of repositories that should not get updat
48
66
# GITHUB_REPOSITORY provide name of org/user and the repo in which this workflow is suppose to run
49
67
# PACKAGE_JSON_LOC=test is a path to package.json file against you want to test
core.info(`This is super strange. We could not find ${dependencyName} neither in dependencies property nor in the devDependencies property. This repo should not show up on the list as it should not show up in search results. On to the next one`);
11473
+
core.info(`We could not find ${dependencyName} neither in dependencies property nor in the devDependencies property. No further steps will be performed. It was found as GitHub search is not perfect and you probably use a package with similar name.`);
11469
11474
continue;
11470
11475
}
11471
11476
@@ -12128,8 +12133,8 @@ function verifyDependencyType(json, dependencyName) {
core.info(`This is super strange. We could not find ${dependencyName} neither in dependencies property nor in the devDependencies property. This repo should not show up on the list as it should not show up in search results. On to the next one`);
61
+
core.info(`We could not find ${dependencyName} neither in dependencies property nor in the devDependencies property. No further steps will be performed. It was found as GitHub search is not perfect and you probably use a package with similar name.`);
0 commit comments