Skip to content

Commit d9c3356

Browse files
committed
Fix cursor/paging. Bump version
- "after" cursor was incorrectly assigned because it occurred after filtering our irrelevant files and should be done first.
1 parent 9007e14 commit d9c3356

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v2
2424
- uses: actions/setup-go@v3
25-
- uses: stackaid/generate-stackaid-json@v1.4
25+
- uses: stackaid/generate-stackaid-json@v1.5
2626
```
2727
2828
This will commit a `stackaid.json` file in your repository which will then automatically show up for funding in the StackAid dashboard.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stackaid-json-generator",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"private": false,
55
"description": "A GitHub action to generate a stackaid.json file based on your repository's dependency graph",
66
"main": "lib/src/main.js",

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const run = async () => {
1515
const repo = process.env.GITHUB_REPOSITORY?.split('/', 2)[1] as string
1616

1717
const stackAidJson: StackAidJson = { version: 1, dependencies: [] }
18-
const direct = []
18+
let direct = []
1919

2020
const glob = '**/'
2121
const summary = await getRepositorySummary(owner, repo, glob)
@@ -38,6 +38,7 @@ const run = async () => {
3838

3939
// We need to query each direct dependency separately since the graphql API
4040
// does NOT support nested dependencies.
41+
direct = uniqBy(direct, (d) => d.repository.url)
4142
for (const dep of direct) {
4243
const {
4344
url: source,

src/queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ export const getRepositorySummary = async (
126126
}
127127

128128
const relevant = edges
129-
.filter((edge) => matches(edge.node.filename, SUMMARY_FILE_TYPES, glob))
130129
.map((edge, i) => ({
131130
...edge,
132131
after: i > 0 ? edges[i - 1].cursor : undefined,
133132
}))
133+
.filter((edge) => matches(edge.node.filename, SUMMARY_FILE_TYPES, glob))
134134

135135
return relevant
136136
}

0 commit comments

Comments
 (0)