Skip to content

Sync KDS Roadmap Project Statuses #106

Sync KDS Roadmap Project Statuses

Sync KDS Roadmap Project Statuses #106

name: Sync KDS Roadmap Project Statuses
on:
schedule:
- cron: "0 * * * *" # Run every hour
workflow_dispatch:
jobs:
sync-projects:
if: github.repository_owner == 'learningequality'
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.LE_BOT_APP_ID }}
private_key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
- name: Check and Sync Project Statuses
uses: actions/github-script@v7
env:
ITERATION_BACKLOG_PROJECT_NUMBER: ${{ secrets.ITERATION_BACKLOG_PROJECT_NUMBER }}
KDS_ROADMAP_PROJECT_NUMBER: ${{ secrets.KDS_ROADMAP_PROJECT_NUMBER }}
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const { synchronizeProjectsStatuses } = require('./.github/githubUtils.js');
const sourceNumber = process.env.ITERATION_BACKLOG_PROJECT_NUMBER;
const targetNumber = process.env.KDS_ROADMAP_PROJECT_NUMBER;
synchronizeProjectsStatuses({context, github, sourceNumber, targetNumber});