Add google-cloud-pubsub dependency #6093
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: Check Changelog Entry | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| check-changelog: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check for changelog entry | |
| id: check-changelog-files | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request; | |
| // Fetch all files changed in the PR | |
| const files = await github.paginate(github.rest.pulls.listFiles, { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: pr.number, | |
| }); | |
| // Check for changelog entry files (excluding TEMPLATE.yaml) | |
| const changelogFiles = files.filter(file => { | |
| const filename = file.filename; | |
| // Check if file is in changelog/ directory | |
| if (!filename.startsWith('changelog/')) { | |
| return false; | |
| } | |
| // Check if it's a YAML file | |
| if (!filename.endsWith('.yaml') && !filename.endsWith('.yml')) { | |
| return false; | |
| } | |
| // Exclude TEMPLATE.yaml | |
| if (filename === 'changelog/TEMPLATE.yaml' || filename === 'changelog/TEMPLATE.yml') { | |
| return false; | |
| } | |
| // Only count added or modified files (not deleted) | |
| return file.status === 'added' || file.status === 'modified'; | |
| }); | |
| if (changelogFiles.length === 0) { | |
| core.setFailed( | |
| '❌ No changelog entry file found!\n\n' + | |
| 'Please add a changelog entry file in the changelog/ directory.\n' + | |
| 'See changelog/README.md for instructions on creating changelog entries.\n' | |
| ); | |
| } else { | |
| const fileNames = changelogFiles.map(f => f.filename).join(', '); | |
| console.log(`✅ Found changelog entry file(s): ${fileNames}`); | |
| // Set output for validation step | |
| core.setOutput('changelog_files', fileNames); | |
| core.setOutput('pr_number', pr.number.toString()); | |
| } | |
| - name: Checkout repository | |
| if: success() | |
| uses: actions/checkout@v6 | |
| - name: Set up uv | |
| if: success() | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| if: success() | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies and nox | |
| if: success() | |
| run: | | |
| uv venv | |
| uv pip install setuptools==80.10.2 wheel | |
| uv sync | |
| - name: Cache Nox virtual environment | |
| if: success() | |
| uses: actions/cache@v5 | |
| with: | |
| path: .nox/ | |
| key: ${{ runner.os }}-uv-nox-changelog-3.13-${{ hashFiles('noxfiles/changelog_nox.py') }} | |
| restore-keys: | | |
| ${{ runner.os }}-uv-nox-changelog-3.13- | |
| - name: Validate changelog entries | |
| if: success() | |
| run: | | |
| uv run nox -s "changelog(validate)" -- --files "${{ steps.check-changelog-files.outputs.changelog_files }}" --pr-number "${{ steps.check-changelog-files.outputs.pr_number }}" |