Skip to content

feat(github): Add cursor-based pagination to integration repos endpoint #230609

feat(github): Add cursor-based pagination to integration repos endpoint

feat(github): Add cursor-based pagination to integration repos endpoint #230609

# Dispatch a request to getsentry to run getsentry test suites
name: getsentry dispatcher
on:
# XXX: We are using `pull_request_target` instead of `pull_request` because we want
# this to run on forks. It allows forks to access secrets safely by
# only running workflows from the main branch. Prefer to use `pull_request` when possible.
#
# See https://github.com/getsentry/sentry/pull/21600 for more details
pull_request_target:
types: [labeled, opened, reopened, synchronize]
# disable all other special privileges
permissions:
# needed for `actions/checkout` to clone the code
contents: read
# needed to remove the pull-request label
pull-requests: write
jobs:
dispatch:
if: "github.event.action != 'labeled' || github.event.label.name == 'Trigger: getsentry tests'"
name: getsentry dispatch
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- name: permissions
run: |
python3 -uS .github/workflows/scripts/getsentry-dispatch-setup \
--repo-id ${{ github.event.repository.id }} \
--pr ${{ github.event.number }} \
--event ${{ github.event.action }} \
--username "$ARG_USERNAME" \
--label-names "$ARG_LABEL_NAMES"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# these can contain special characters
ARG_USERNAME: ${{ github.event.pull_request.user.login }}
ARG_LABEL_NAMES: ${{ toJSON(github.event.pull_request.labels.*.name) }}
- name: Check for file changes
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
- name: Get changed files for selective testing
id: changed-files
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/pulls/${{ github.event.number }}/files \
--paginate | python3 .github/workflows/scripts/parse-pr-files.py >> "$GITHUB_OUTPUT"
- name: getsentry token
uses: getsentry/action-github-app-token@5c1e90706fe007857338ac1bfbd7a4177db2f789 # v4.0.0
id: getsentry
with:
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
- name: Wait for PR merge commit
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
id: mergecommit
with:
github-token: ${{ steps.getsentry.outputs.token }}
script: |
const { waitForMergeCommit } = await import(`${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/wait-for-merge-commit.js`);
await waitForMergeCommit({
github,
context,
core,
});
- name: Dispatch getsentry tests
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
SENTRY_CHANGED_FILES: ${{ steps.changed-files.outputs.files }}
SENTRY_PREVIOUS_FILENAMES: ${{ steps.changed-files.outputs.previous-filenames }}
with:
github-token: ${{ steps.getsentry.outputs.token }}
script: |
const { dispatch } = await import(`${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/getsentry-dispatch.js`);
await dispatch({
github,
context,
core,
mergeCommitSha: '${{ steps.mergecommit.outputs.mergeCommitSha }}',
fileChanges: ${{ toJson(steps.changes.outputs) }},
sentryChangedFiles: process.env.SENTRY_CHANGED_FILES,
sentryPreviousFilenames: process.env.SENTRY_PREVIOUS_FILENAMES,
});