|
6 | 6 | auto-approve: |
7 | 7 | runs-on: ubuntu-latest |
8 | 8 | if: | |
9 | | - ( |
| 9 | + ( |
10 | 10 | github.actor == 'getsentry-release' || |
11 | 11 | github.actor == 'sentry-release-bot[bot]' |
12 | | - ) && ( |
13 | | - startsWith(github.event.issue.title, 'publish: getsentry/arroyo@') || |
14 | | - startsWith(github.event.issue.title, 'publish: getsentry/auto-type-annotate@') || |
15 | | - startsWith(github.event.issue.title, 'publish: getsentry/devenv@') || |
16 | | - startsWith(github.event.issue.title, 'publish: getsentry/infra-event-notifier@') || |
17 | | - startsWith(github.event.issue.title, 'publish: getsentry/jest-sentry-environment@') || |
18 | | - startsWith(github.event.issue.title, 'publish: getsentry/js-source-scopes@') || |
19 | | - startsWith(github.event.issue.title, 'publish: getsentry/json-schema-diff@') || |
20 | | - startsWith(github.event.issue.title, 'publish: getsentry/objectstore/clients@') || |
21 | | - startsWith(github.event.issue.title, 'publish: getsentry/ophio@') || |
22 | | - startsWith(github.event.issue.title, 'publish: getsentry/pdb@') || |
23 | | - startsWith(github.event.issue.title, 'publish: getsentry/pyo3-python-tracing-subscriber@') || |
24 | | - startsWith(github.event.issue.title, 'publish: getsentry/pytest-sentry@') || |
25 | | - startsWith(github.event.issue.title, 'publish: getsentry/relay/py@') || |
26 | | - startsWith(github.event.issue.title, 'publish: getsentry/responses@') || |
27 | | - startsWith(github.event.issue.title, 'publish: getsentry/rust-proguard@') || |
28 | | - startsWith(github.event.issue.title, 'publish: getsentry/rust-sourcemap@') || |
29 | | - startsWith(github.event.issue.title, 'publish: getsentry/rust-usage-accountant@') || |
30 | | - startsWith(github.event.issue.title, 'publish: getsentry/script-runner@') || |
31 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-forked-django-stubs@') || |
32 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-forked-djangorestframework-stubs@') || |
33 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-forked-jsonnet@') || |
34 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-infra-tools@') || |
35 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-kafka-management@') || |
36 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-kafka-schemas@') || |
37 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-protos@') || |
38 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-redis-tools@') || |
39 | | - startsWith(github.event.issue.title, 'publish: getsentry/service-registry@') || |
40 | | - startsWith(github.event.issue.title, 'publish: getsentry/skrooge@') || |
41 | | - startsWith(github.event.issue.title, 'publish: getsentry/snuba-sdk@') || |
42 | | - startsWith(github.event.issue.title, 'publish: getsentry/statsdproxy@') || |
43 | | - startsWith(github.event.issue.title, 'publish: getsentry/status-page-list@') || |
44 | | - startsWith(github.event.issue.title, 'publish: getsentry/streams/sentry_streams@') || |
45 | | - startsWith(github.event.issue.title, 'publish: getsentry/symbolic@') || |
46 | | - startsWith(github.event.issue.title, 'publish: getsentry/usage-accountant@') || |
47 | | - startsWith(github.event.issue.title, 'publish: getsentry/watto@') || |
48 | | - startsWith(github.event.issue.title, 'publish: getsentry/sentry-api-schema@') || |
49 | | - false |
50 | | - ) |
| 12 | + ) && |
| 13 | + startsWith(github.event.issue.title, 'publish: ') |
51 | 14 | steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + sparse-checkout: auto-approve-repos.txt |
| 18 | + sparse-checkout-cone-mode: false |
52 | 19 | - name: Get auth token |
53 | 20 | id: token |
54 | 21 | uses: actions/create-github-app-token@v2.2.1 |
55 | 22 | with: |
56 | 23 | app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} |
57 | 24 | private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} |
58 | | - - run: gh issue edit ${{ github.event.issue.html_url }} --add-label accepted |
| 25 | + - name: Auto-approve if repo is in the list |
59 | 26 | env: |
60 | 27 | GH_TOKEN: ${{ steps.token.outputs.token }} |
| 28 | + ISSUE_TITLE: ${{ github.event.issue.title }} |
| 29 | + ISSUE_URL: ${{ github.event.issue.html_url }} |
| 30 | + run: | |
| 31 | + REPO=$(echo "$ISSUE_TITLE" | sed -n 's/^publish: \(.*\)@.*/\1/p') |
| 32 | + if [ -n "$REPO" ] && grep -qxF "$REPO" auto-approve-repos.txt; then |
| 33 | + gh issue edit "$ISSUE_URL" --add-label accepted |
| 34 | + fi |
0 commit comments