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
Add support for discovering and copying package.json files to publish_repo (#8)
* Add support for discovering and copying package.json files to publish_repo
- Refactor github specific constants and methods.
- Add debug info useful for dry runs
- Bump version
* Add different publish repo for test output
Copy file name to clipboardExpand all lines: README.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ jobs:
21
21
runs-on: ubuntu-latest
22
22
steps:
23
23
- uses: actions/checkout@v2
24
-
- uses: actions/setup-go@v3
25
-
- uses: stackaid/generate-stackaid-json@v1.7
24
+
- uses: actions/setup-go@v3# Only required for Go based repos
25
+
- uses: stackaid/generate-stackaid-json@v1.8
26
26
```
27
27
28
28
This will commit a `stackaid.json` file in your repository which will then automatically show up for funding in the StackAid dashboard.
@@ -35,9 +35,32 @@ The action also supports a few useful `inputs` and `outputs` so you can publish
35
35
- `publish_repo`: The full name of the repository, (eg: `username/repo-name`) to publish the generated stackaid.json file. Defaults to the current repository.
36
36
- `publish_path`: The path to publish to. By default the stackaid.json file is published to the root of the repository.
37
37
- `skip_publish`: Set to `true` if you do not want to publish the generated file.
38
+
- `include_package_json`: Only relavant when `publish_repo` is specified. Set to `true` if you want to copy `package.json` files to a non-sensitive repo. See the section below. Defaults to `true`.
38
39
39
40
**Note**: If you publish to a separate repo you will need to provide a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with the appropriate repo permissions.
40
41
41
42
### Outputs
42
43
43
44
- `stackaid_json`: The generated stackaid.json file as a string.
45
+
46
+
## Funding dependencies in sensitive repositories.
47
+
48
+
While this action is primarily designed to support languages StackAid does not natively support, it can also be used to allow you to fund dependencies in repositories without giving StackAid access to your source code.
49
+
50
+
Here's a simple guide:
51
+
52
+
1. Create a new empty repository and grant acess to our [GitHub app](https://github.com/apps/stackaid). This repository will just store the dependecy files you want to fund.
53
+
54
+
2. Create a [personal access token](https://github.com/settings/tokens/new) with full `repo` access and set the expriation to "No Expiration"
55
+
<img src="./docs/images/add_access_token.png" />
56
+
57
+
3. Add the token as a secret to your github action workflow: https://docs.github.com/en/actions/security-guides/encrypted-secrets
58
+
<img src="./docs/images/add_secret.png"/>
59
+
60
+
4. Configure this GitHub action to publish to your new repository.
61
+
62
+
```yaml
63
+
token: ${{ secrets.STACKAID_ACCESS_TOKEN }}
64
+
publish_repo: 'owner/name' # of new repository
65
+
publish_path: ${{ github.repository }} # Publishes dependecy files under the current repo name. Avoids name conflicts when using this action on multiple repositories.
Copy file name to clipboardExpand all lines: action.yml
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,10 @@ inputs:
21
21
description: 'Source code root directory'
22
22
default: ${{ github.workspace }}
23
23
required: false
24
+
include_package_json:
25
+
description: "If true and publish_repo is different from the working repository, then package.json files will be copied to publish_repo. Use this option when you don't want StackAid to have access to your source."
0 commit comments