|
| 1 | +name: Issue Sync |
| 2 | + |
| 3 | +on: [issues, issue_comment] |
| 4 | + |
| 5 | +jobs: |
| 6 | + sync-issue: |
| 7 | + name: Sync Issue with Project Board |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - name: Checkout |
| 11 | + uses: actions/checkout@v4 |
| 12 | + |
| 13 | + - name: Setup Node.js |
| 14 | + uses: actions/setup-node@v4 |
| 15 | + with: |
| 16 | + node-version: '20' |
| 17 | + cache: 'yarn' |
| 18 | + cache-dependency-path: 'yarn.lock' |
| 19 | + |
| 20 | + # Cache node_modules |
| 21 | + - name: Cache node_modules |
| 22 | + uses: actions/cache@v3 |
| 23 | + id: cache-modules |
| 24 | + with: |
| 25 | + path: | |
| 26 | + tools/@aws-cdk/project-sync/node_modules |
| 27 | + node_modules |
| 28 | + key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} |
| 29 | + restore-keys: | |
| 30 | + ${{ runner.os }}-modules- |
| 31 | +
|
| 32 | + - name: Install dependencies |
| 33 | + if: steps.cache-modules.outputs.cache-hit != 'true' |
| 34 | + run: | |
| 35 | + cd tools/@aws-cdk/project-sync |
| 36 | + yarn install --frozen-lockfile |
| 37 | +
|
| 38 | + # Cache build output |
| 39 | + - name: Cache build output |
| 40 | + uses: actions/cache@v3 |
| 41 | + id: cache-build |
| 42 | + with: |
| 43 | + path: | |
| 44 | + tools/@aws-cdk/project-sync/lib/*.js |
| 45 | + tools/@aws-cdk/project-sync/bin/*.js |
| 46 | + key: ${{ runner.os }}-build-${{ hashFiles('tools/@aws-cdk/project-sync/lib', 'tools/@aws-cdk/project-sync/bin') }} |
| 47 | + restore-keys: | |
| 48 | + ${{ runner.os }}-build- |
| 49 | +
|
| 50 | + - name: Build project-sync |
| 51 | + if: steps.cache-build.outputs.cache-hit != 'true' |
| 52 | + run: | |
| 53 | + cd tools/@aws-cdk/project-sync |
| 54 | + yarn build |
| 55 | +
|
| 56 | + - name: Run issue-sync |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ secrets.PROJECT_SYNC_GITHUB_TOKEN }} |
| 59 | + ISSUE_NUMBER: ${{ github.event.issue.number }} |
| 60 | + REPOSITORY: ${{ github.repository }} |
| 61 | + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER || 302 }} |
| 62 | + run: | |
| 63 | + cd tools/@aws-cdk/project-sync |
| 64 | + node bin/issue-sync.js |
0 commit comments