Skip to content

Commit

Permalink
Fix cursor/paging. Bump version
Browse files Browse the repository at this point in the history
- "after" cursor was incorrectly assigned because it occurred after filtering our irrelevant files and should be done first.
  • Loading branch information
wescarr committed Sep 8, 2022
1 parent 9007e14 commit d9c3356
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
- uses: stackaid/generate-stackaid-json@v1.4
- uses: stackaid/generate-stackaid-json@v1.5
```
This will commit a `stackaid.json` file in your repository which will then automatically show up for funding in the StackAid dashboard.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stackaid-json-generator",
"version": "1.4.0",
"version": "1.5.0",
"private": false,
"description": "A GitHub action to generate a stackaid.json file based on your repository's dependency graph",
"main": "lib/src/main.js",
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const run = async () => {
const repo = process.env.GITHUB_REPOSITORY?.split('/', 2)[1] as string

const stackAidJson: StackAidJson = { version: 1, dependencies: [] }
const direct = []
let direct = []

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

// We need to query each direct dependency separately since the graphql API
// does NOT support nested dependencies.
direct = uniqBy(direct, (d) => d.repository.url)
for (const dep of direct) {
const {
url: source,
Expand Down
2 changes: 1 addition & 1 deletion src/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ export const getRepositorySummary = async (
}

const relevant = edges
.filter((edge) => matches(edge.node.filename, SUMMARY_FILE_TYPES, glob))
.map((edge, i) => ({
...edge,
after: i > 0 ? edges[i - 1].cursor : undefined,
}))
.filter((edge) => matches(edge.node.filename, SUMMARY_FILE_TYPES, glob))

return relevant
}
Expand Down

0 comments on commit d9c3356

Please sign in to comment.