Final '25 community-related automations package #39
Workflow file for this run
This file contains hidden or 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
| name: Update community pull requests spreadsheet | |
| on: | |
| workflow_call: | |
| secrets: | |
| LE_BOT_APP_ID: | |
| description: "GitHub App ID for authentication" | |
| required: true | |
| LE_BOT_PRIVATE_KEY: | |
| description: "GitHub App Private Key for authentication" | |
| required: true | |
| CONTRIBUTIONS_SPREADSHEET_ID: | |
| required: true | |
| CONTRIBUTIONS_SHEET_NAME: | |
| required: true | |
| GH_UPLOADER_GCP_SA_CREDENTIALS: | |
| required: true | |
| jobs: | |
| check-if-contributor: | |
| name: Check if author is contributor | |
| uses: learningequality/.github/.github/workflows/is-contributor.yml@main | |
| secrets: | |
| LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }} | |
| LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }} | |
| with: | |
| username: ${{ github.event.pull_request.user.login }} | |
| author_association: ${{ github.event.pull_request.author_association }} | |
| update-spreadsheet: | |
| needs: [check-if-contributor] | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.check-if-contributor.outputs.is_contributor == 'true' }} | |
| steps: | |
| - name: Generate App Token | |
| id: generate-token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: ${{ secrets.LE_BOT_APP_ID }} | |
| private_key: ${{ secrets.LE_BOT_PRIVATE_KEY }} | |
| - name: Checkout .github repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: learningequality/.github | |
| ref: main | |
| token: ${{ steps.generate-token.outputs.token }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run script | |
| id: script | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ steps.generate-token.outputs.token }} | |
| script: | | |
| const script = require('./scripts/update-pr-spreadsheet.js'); | |
| return await script({ github, context, core }); | |
| env: | |
| CONTRIBUTIONS_SPREADSHEET_ID: ${{ secrets.CONTRIBUTIONS_SPREADSHEET_ID }} | |
| CONTRIBUTIONS_SHEET_NAME: ${{ secrets.CONTRIBUTIONS_SHEET_NAME }} | |
| GOOGLE_CREDENTIALS: ${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }} |