|
| 1 | +name: Coordinate Java team memory (opt-in) |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + source_repository: |
| 7 | + description: Allowlisted Java source repository (owner/name) |
| 8 | + required: true |
| 9 | + default: microsoft/vscode-java-pack |
| 10 | + type: string |
| 11 | + source_run_id: |
| 12 | + description: Source push workflow run ID (automatic dispatch only) |
| 13 | + required: false |
| 14 | + type: string |
| 15 | + source_run_attempt: |
| 16 | + description: Source workflow attempt (required with source_run_id) |
| 17 | + required: false |
| 18 | + type: string |
| 19 | + push_before: |
| 20 | + description: Requested reconciliation ancestor SHA, not an attested original push boundary |
| 21 | + required: false |
| 22 | + type: string |
| 23 | + push_after: |
| 24 | + description: Source push run head SHA (required with source_run_id) |
| 25 | + required: false |
| 26 | + type: string |
| 27 | + pull_request_number: |
| 28 | + description: Merged source PR to reconcile manually (instead of source inputs) |
| 29 | + required: false |
| 30 | + type: string |
| 31 | + |
| 32 | +permissions: {} |
| 33 | + |
| 34 | +concurrency: |
| 35 | + group: issuelens-team-memory-wiki-microsoft-vscode-java-pack |
| 36 | + queue: max |
| 37 | + cancel-in-progress: false |
| 38 | + |
| 39 | +jobs: |
| 40 | + reconcile: |
| 41 | + if: >- |
| 42 | + vars.ISSUELENS_TEAM_MEMORY_COORDINATOR_ENABLED == 'true' && |
| 43 | + github.repository == 'microsoft/vscode-java-pack' && |
| 44 | + github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && |
| 45 | + github.event_name == 'workflow_dispatch' |
| 46 | + runs-on: ubuntu-latest |
| 47 | + timeout-minutes: 30 |
| 48 | + permissions: |
| 49 | + contents: read |
| 50 | + pull-requests: read |
| 51 | + actions: read |
| 52 | + id-token: write |
| 53 | + env: |
| 54 | + ISSUELENS_SOURCE_REPOSITORIES: >- |
| 55 | + {"microsoft/vscode-java-pack":104967329, |
| 56 | + "microsoft/vscode-java-debug":102584737, |
| 57 | + "microsoft/vscode-java-test":110522074, |
| 58 | + "microsoft/vscode-java-dependency":129053101, |
| 59 | + "microsoft/vscode-maven":116921700, |
| 60 | + "microsoft/vscode-gradle":216314492, |
| 61 | + "microsoft/java-debug":102583752, |
| 62 | + "microsoft/build-server-for-gradle":626812412} |
| 63 | + steps: |
| 64 | + - name: Select allowlisted source for read-only authentication |
| 65 | + id: selection |
| 66 | + shell: bash |
| 67 | + env: |
| 68 | + SOURCE_REPOSITORY: ${{ inputs.source_repository }} |
| 69 | + run: | |
| 70 | + if ! jq -e --arg repository "$SOURCE_REPOSITORY" 'has($repository)' <<< "$ISSUELENS_SOURCE_REPOSITORIES" > /dev/null; then |
| 71 | + echo "::error::Source repository is not allowlisted" |
| 72 | + exit 1 |
| 73 | + fi |
| 74 | + echo "source-name=${SOURCE_REPOSITORY#microsoft/}" >> "$GITHUB_OUTPUT" |
| 75 | + if [[ "$SOURCE_REPOSITORY" == "microsoft/vscode-java-pack" ]]; then |
| 76 | + echo "external=false" >> "$GITHUB_OUTPUT" |
| 77 | + else |
| 78 | + echo "external=true" >> "$GITHUB_OUTPUT" |
| 79 | + fi |
| 80 | +
|
| 81 | + - name: Get read-only token for the selected external source |
| 82 | + if: steps.selection.outputs.external == 'true' |
| 83 | + id: source-token |
| 84 | + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 |
| 85 | + with: |
| 86 | + client-id: ${{ secrets.ISSUELENS_SOURCE_READ_APP_CLIENT_ID }} |
| 87 | + private-key: ${{ secrets.ISSUELENS_SOURCE_READ_APP_PRIVATE_KEY }} |
| 88 | + owner: microsoft |
| 89 | + repositories: ${{ steps.selection.outputs.source-name }} |
| 90 | + permission-actions: read |
| 91 | + permission-contents: read |
| 92 | + permission-pull-requests: read |
| 93 | + |
| 94 | + - name: Reconcile team memory and validate final receipts |
| 95 | + uses: microsoft/IssueLens/.github/actions/issuelens@a81d2d96167fc0e69ac631c2edc85f858e693289 |
| 96 | + with: |
| 97 | + request-type: team-memory |
| 98 | + github-token: ${{ github.token }} |
| 99 | + source-repository: ${{ inputs.source_repository }} |
| 100 | + source-repositories: ${{ env.ISSUELENS_SOURCE_REPOSITORIES }} |
| 101 | + source-github-token: ${{ steps.selection.outputs.external == 'false' && github.token || steps.source-token.outputs.token }} |
| 102 | + source-run-id: ${{ inputs.source_run_id }} |
| 103 | + source-run-attempt: ${{ inputs.source_run_attempt }} |
| 104 | + push-before: ${{ inputs.push_before }} |
| 105 | + push-after: ${{ inputs.push_after }} |
| 106 | + pull-request-number: ${{ inputs.pull_request_number }} |
| 107 | + azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} |
| 108 | + azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
| 109 | + azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
| 110 | + agent-url: ${{ secrets.ISSUELENS_AGENT_URL }} |
| 111 | + agent-scope: ${{ secrets.ISSUELENS_AGENT_SCOPE }} |
| 112 | + output-mode: activity |
| 113 | + summary-mode: status |
0 commit comments