-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: new project syncing setup #3136
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Add PRs and Issues to the Project Board | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0,6,12,18 * * *' | ||
|
||
env: | ||
REPOS_LIST: "iroh-doctor-server quinn" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to list out all the repos we're interested in. @ramfox unless you have specifics I'll just either add a very long list we used for the last iteration or try to just do all of them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ones we did for the last iteration should be right! |
||
|
||
jobs: | ||
add-to-project: | ||
name: Add to project board | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ secrets.N0_BOT_APP_ID }} | ||
private-key: ${{ secrets.PROJECT_BOARD_PKEY }} | ||
owner: n0-computer | ||
|
||
- name: Update PRs | ||
env: | ||
GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
run: | | ||
for REPO in $REPOS_LIST; do | ||
echo "Processing repository: $REPO" | ||
|
||
gh pr list --repo n0-computer/$REPO --state open --json number,projectItems | jq -r '.[] | select(.projectItems | length == 0) | .number' > pr_list.txt | ||
while read -r PR_NUMBER; do | ||
echo "Processing PR #$PR_NUMBER" | ||
gh pr edit "$PR_NUMBER" --repo n0-computer/$REPO --add-project iroh | ||
done < pr_list.txt | ||
done | ||
|
||
- name: Update ISSUEs | ||
env: | ||
GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
run: | | ||
for REPO in $REPOS_LIST; do | ||
gh issue list --repo n0-computer/$REPO --state open --json number,projectItems | jq -r '.[] | select(.projectItems | length == 0) | .number' > issue_list.txt | ||
while read -r ISSUE_NUMBER; do | ||
echo "Processing Issue #$ISSUE_NUMBER" | ||
gh issue edit "$ISSUE_NUMBER" --repo n0-computer/$REPO --add-project iroh | ||
done < issue_list.txt | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want a different schedule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add manually triggering so that you're not entirely stuck.
But also, maybe every 1h? Or are there rate limits we need to worry about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with every hour unless there are rate limits.
And also, if possible a manual trigger.