Skip to content

Commit

Permalink
Merge pull request #36 from unyt-org/feat-update-pr-workflow
Browse files Browse the repository at this point in the history
Add auto update PR Workflow
  • Loading branch information
benStre authored Jan 18, 2024
2 parents 3430900 + ab54a05 commit 6a942d0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/update-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Refresh PRs
on:
push:
branches:
- main

permissions:
pull-requests: write

jobs:
trigger-pr-update:
runs-on: ubuntu-latest

steps:
- uses: actions/github-script@v7
with:
script: |
// Get a list of all issues created by the PR opener
// See: https://octokit.github.io/rest.js/#pagination
const creator = context.payload.sender.login
const prs = await github.request('GET /repos/{owner}/{repo}/pulls', {
owner: context.repo.owner,
repo: context.repo.repo,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
for (const pr of prs.data) {
if (pr.state !== 'open') continue;
console.log("Refreshing PR diff for #" + pr.number + " (" + pr.title + ")");
await github.request('PATCH /repos/{owner}/{repo}/pulls/{pull_number}', {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
base: 'develop',
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
await github.request('PATCH /repos/{owner}/{repo}/pulls/{pull_number}', {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
base: 'main',
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
}
1 change: 1 addition & 0 deletions runtime/pointers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ export class Pointer<T = any> extends Ref<T> {
// check read permissions
pointer.assertEndpointCanRead(SCOPE?.sender)


return pointer;
}

Expand Down
1 change: 0 additions & 1 deletion runtime/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ export class Storage {
}

public static setPointer(pointer:Pointer, listen_for_changes = true, location:StorageLocation|undefined = this.#primary_location, partialUpdateKey: unknown = NOT_EXISTING): Promise<boolean>|boolean {

if (!pointer.value_initialized) {
// logger.warn("pointer value " + pointer.idString() + " not available, cannot save in storage");
this.#storage_active_pointers.delete(pointer);
Expand Down

0 comments on commit 6a942d0

Please sign in to comment.