[Bug]: Permissions - Removing Hardware wallet accounts doesn't clear up Permission site entry #1374
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: Triage Agent Forwarder | |
| on: | |
| issues: | |
| types: [labeled, opened] | |
| concurrency: | |
| group: triage-forwarder-${{ github.event.issue.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| forward: | |
| runs-on: ubuntu-latest | |
| if: >- | |
| (github.event.action == 'opened') || | |
| (github.event.action == 'labeled' && github.event.label.name == 'ta-needs-triage') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Determine trigger mode | |
| id: trigger | |
| run: | | |
| if [ "${{ github.event.action }}" = "opened" ]; then | |
| TRIGGER_MODE="on_create" | |
| else | |
| TRIGGER_MODE="label" | |
| fi | |
| echo "trigger_mode=$TRIGGER_MODE" >> "$GITHUB_OUTPUT" | |
| - name: Get OIDC Token | |
| id: oidc | |
| run: | | |
| OIDC_TOKEN=$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \ | |
| "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=api://token-exchange-service" | jq -r '.value') | |
| echo "::add-mask::$OIDC_TOKEN" | |
| echo "oidc_token=$OIDC_TOKEN" >> "$GITHUB_OUTPUT" | |
| - name: Exchange for Installation Token | |
| id: exchange | |
| env: | |
| OIDC_TOKEN: ${{ steps.oidc.outputs.oidc_token }} | |
| run: | | |
| RESPONSE=$(curl -sSf -X POST "${{ vars.TOKEN_EXCHANGE_URL }}/api/exchange/token" \ | |
| -H "Content-Type: application/json" \ | |
| -d "$(jq -cn \ | |
| --arg oidcToken "$OIDC_TOKEN" \ | |
| --arg targetRepo "MetaMask/triage-agent" \ | |
| '{oidcToken: $oidcToken, targetRepo: $targetRepo, requested_permissions: {contents: "write", metadata: "read"}}')") | |
| TOKEN=$(echo "$RESPONSE" | jq -r '.token') | |
| echo "::add-mask::$TOKEN" | |
| echo "token=$TOKEN" >> "$GITHUB_OUTPUT" | |
| - name: Dispatch to triage-agent | |
| env: | |
| TOKEN: ${{ steps.exchange.outputs.token }} | |
| run: | | |
| curl -sSf -X POST \ | |
| -H "Authorization: token $TOKEN" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/MetaMask/triage-agent/dispatches" \ | |
| -d "$(jq -cn \ | |
| --arg owner "${{ github.repository_owner }}" \ | |
| --arg name "${{ github.event.repository.name }}" \ | |
| --arg number "${{ github.event.issue.number }}" \ | |
| --arg action "${{ github.event.action }}" \ | |
| --arg label "${{ github.event.label.name }}" \ | |
| --arg trigger_mode "${{ steps.trigger.outputs.trigger_mode }}" \ | |
| '{event_type: "triage-issue", client_payload: {repo_owner: $owner, repo_name: $name, issue_number: $number, event_action: $action, event_label_name: $label, trigger_mode: $trigger_mode}}')" |