-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
||
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 |