-
Notifications
You must be signed in to change notification settings - Fork 23
build: implement SDK breaking change detection #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,13 +35,15 @@ jobs: | |
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set version (PR) | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| env: | ||
| PR_HEAD_REF: "${{ github.event.pull_request.head.ref }}" | ||
| run: | | ||
| echo REF_NAME="$PR_HEAD_REF" >> $GITHUB_ENV | ||
| echo REF_NAME="${PR_HEAD_REF}" >> $GITHUB_ENV | ||
| echo SHA="${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Set env variables (Branch/Tag) | ||
|
|
@@ -117,24 +119,55 @@ jobs: | |
| tenant_id: ${{ secrets.AZURE_TENANT_ID }} | ||
| client_id: ${{ secrets.AZURE_CLIENT_ID }} | ||
|
|
||
| - name: Retrieve github PAT secrets | ||
| id: retrieve-secret-pat | ||
| - name: Get Azure Key Vault secrets | ||
| id: get-kv-secrets | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BRE let me know that use of the devops bot is deprecated, so I went ahead and refactored to that here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For what it's worth, there's no sensible alternative for commit signing yet (ie, workflows that retrieve the devops bot gpg key to setup signing), signing with GHApps is a nightmare. Went through the workflow and that's not the case here, great call on refactoring it! ๐ |
||
| uses: bitwarden/gh-actions/get-keyvault-secrets@main | ||
| with: | ||
| keyvault: "bitwarden-ci" | ||
| secrets: "github-pat-bitwarden-devops-bot-repo-scope" | ||
| keyvault: gh-org-bitwarden | ||
| secrets: "BW-GHAPP-ID,BW-GHAPP-KEY" | ||
|
|
||
| - name: Generate GH App token | ||
| uses: actions/create-github-app-token@30bf6253fa41bdc8d1501d202ad15287582246b4 # v2.0.3 | ||
| id: app-token | ||
| with: | ||
vvolkgang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }} | ||
| private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }} | ||
| owner: bitwarden | ||
| repositories: sdk-internal | ||
| permission-actions: write | ||
|
|
||
| - name: Log out from Azure | ||
| uses: bitwarden/gh-actions/azure-logout@main | ||
|
|
||
| - name: Trigger WASM publish | ||
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | ||
| with: | ||
| github-token: ${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }} | ||
| github-token: ${{ steps.app-token.outputs.token }} | ||
| script: | | ||
| await github.rest.actions.createWorkflowDispatch({ | ||
| owner: 'bitwarden', | ||
| repo: 'sdk-internal', | ||
| workflow_id: 'publish-wasm-internal.yml', | ||
| ref: 'main', | ||
| }) | ||
|
|
||
| trigger-breaking-change-check: | ||
| name: Trigger client breaking change checks | ||
| if: github.event_name == 'pull_request' | ||
| needs: build | ||
| permissions: | ||
| contents: write | ||
| actions: write | ||
| pull-requests: write | ||
| id-token: write | ||
| uses: ./.github/workflows/detect-breaking-changes.yml | ||
| secrets: inherit | ||
| with: | ||
| pr_number: ${{ github.event.number }} | ||
| pr_head_sha: ${{ github.event.pull_request.head.sha }} | ||
| pr_head_ref: ${{ github.event.pull_request.head.ref }} | ||
| build_run_id: ${{ github.run_id }} | ||
| client_repo: "bitwarden/clients" | ||
| client_event_type: "sdk-breaking-change-check" | ||
| client_label: "typescript" | ||
| client_workflow: "sdk-breaking-change-check.yml" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was recommended as a warning by the workflow linter so I did it.