Skip to content

Commit b9865ff

Browse files
authored
chore: use github app for issue creation (#28)
* chore: use github app for issue creation * fix: try v2 * fix: no installation id? * chore: only run on one for testing * fix: muon * why isn't it running every time? * fix: final updates
1 parent 5c1639d commit b9865ff

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/integration-test.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ jobs:
4242

4343
runs-on: ${{ matrix.package.gpu && format('cirun-aws-gpu--{0}', github.run_id) || 'ubuntu-latest' }}
4444

45-
env:
46-
# This env variable is used by the `gh` CLI
47-
GH_TOKEN: ${{ secrets.TOKEN_FOR_ISSUE_WRITE }}
48-
4945
steps:
5046

5147
- uses: actions/checkout@v4
@@ -124,10 +120,20 @@ jobs:
124120
run: |
125121
echo "Test failed for ${{ matrix.package.name }}"
126122
echo "failure_type=test" >> $GITHUB_ENV
123+
124+
- name: Generate tokens
125+
id: app-token
126+
if: failure()
127+
uses: actions/create-github-app-token@v2
128+
with:
129+
app-id: ${{ vars.ISSUE_CREATOR_APP_ID }}
130+
private-key: ${{ secrets.ISSUE_CREATOR_PRIVATE_KEY }}
127131

128132
- name: Check for open failure issue
129-
if: failure() && github.event_name == 'schedule'
133+
if: failure()
130134
id: find_issue
135+
env:
136+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
131137
run: |
132138
ISSUE_TITLE="Integration Testing CI ${failure_type^} Failure on python ${{ matrix.python }}${{matrix.is_pre && ' with prerelease dependencies' || ''}}"
133139
echo "Checking for existing issue: $ISSUE_TITLE"
@@ -142,6 +148,8 @@ jobs:
142148
143149
- name: Report failure issue
144150
if: failure() && env.issue_exists == 'false' && github.event_name == 'schedule'
151+
env:
152+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
145153
run: |
146154
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
147155
ISSUE_BODY="The daily CI failed on ${failure_type} for ${{ matrix.package.name }} failed. Please go to [the logs of the integration testing repo](${RUN_URL}) to review. @scverse/anndata"

0 commit comments

Comments
 (0)