Skip to content

test(Spanner): Bulk Migration: add SQL Server integration testing support to SourceDbToSpanner template #14431

test(Spanner): Bulk Migration: add SQL Server integration testing support to SourceDbToSpanner template

test(Spanner): Bulk Migration: add SQL Server integration testing support to SourceDbToSpanner template #14431

name: Enforce labels for release notes
on:
# zizmor: ignore[dangerous-triggers]
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Close Dependabot PRs modifying autogenerated requirements
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && (github.event.action == 'opened' || github.event.action == 'synchronize') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
FILES=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/files" --paginate --jq '.[].filename')
TOUCHES_RESTRICTED_REQS=false
for file in $FILES; do
if [[ "$file" =~ ^python/src/main/python/(.*/)?(requirements\.txt|requirements_all\.txt)$ ]]; then
TOUCHES_RESTRICTED_REQS=true
echo "Found restricted requirements file: $file"
break
fi
done
if [ "$TOUCHES_RESTRICTED_REQS" = true ]; then
echo "Closing PR #$PR_NUMBER because it touches autogenerated Python requirements files."
COMMENT="Closing this PR because dependabot updates for 'python/src/main/python/**/requirements*.txt' are not allowed due to autogenerated lockfiles. Python dependencies are managed and updated via the automated weekly update workflow (python/generate_all_dependencies.sh)."
gh pr close "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --comment "$COMMENT"
fi
- name: Add extra labels to Dependabot PRs
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.event.action == 'opened' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: gh pr edit "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --add-label "ignore-for-release"
- uses: mheap/github-action-required-labels@23e10fde7e062233401931a0eece796cd9bf3177 # v5.6.0
with:
mode: minimum
count: 1
# Note: If updating these labels, also update .github/release.yml
# and contributor-docs/code-contributions.md.
labels: |
addition
bug-fix
ignore-for-release
improvement
new-template
package-upgrade
message: "This PR is being prevented from merging because you have not added any of the following labels: [addition, bug-fix, ignore-for-release, improvement, new-template, package-upgrade]. You'll need to add one before this PR can be merged so that these can be used for release notes. For more information, see https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/main/contributor-docs/code-contributions.md#release-notes"