Skip to content

Commit e1f12d6

Browse files
authored
Add a workflow for cancelling stuck pulumi locks (#589)
<!-- Provide a brief summary of your changes --> ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> The following PR adds an easy way to cancel stuck pulumi jobs (could be temporary). ## How Has This Been Tested? <!-- Have you tested this in a real application? Which scenarios were tested? --> ## Breaking Changes <!-- Will users need to update their code or configurations? --> ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [ ] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [ ] My code follows the repository's style guidelines - [ ] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed ## Additional context <!-- Add any other context, implementation notes, or design decisions --> Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent 8bd13d5 commit e1f12d6

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Cancel Pulumi Lock
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Environment to cancel lock for'
8+
required: true
9+
type: choice
10+
options:
11+
- staging
12+
- production
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
PULUMI_VERSION: "3.188.0"
19+
20+
jobs:
21+
cancel-lock:
22+
name: Cancel Pulumi Lock
23+
runs-on: ubuntu-latest
24+
environment: ${{ inputs.environment }}
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
28+
29+
- name: Setup Pulumi
30+
uses: pulumi/actions@cc7494be991dba0978f7ffafaf995b0449a0998e
31+
with:
32+
pulumi-version: ${{ env.PULUMI_VERSION }}
33+
34+
- name: Authenticate to Google Cloud (Staging)
35+
if: inputs.environment == 'staging'
36+
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
37+
with:
38+
credentials_json: ${{ secrets.GCP_STAGING_SERVICE_ACCOUNT_KEY }}
39+
40+
- name: Authenticate to Google Cloud (Production)
41+
if: inputs.environment == 'production'
42+
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
43+
with:
44+
credentials_json: ${{ secrets.GCP_PROD_SERVICE_ACCOUNT_KEY }}
45+
46+
- name: Setup Google Cloud SDK (Staging)
47+
if: inputs.environment == 'staging'
48+
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db
49+
with:
50+
project_id: mcp-registry-staging
51+
52+
- name: Setup Google Cloud SDK (Production)
53+
if: inputs.environment == 'production'
54+
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db
55+
with:
56+
project_id: mcp-registry-prod
57+
58+
- name: Cancel Pulumi Lock (Staging)
59+
if: inputs.environment == 'staging'
60+
working-directory: ./deploy
61+
run: |
62+
echo "${{ secrets.PULUMI_STAGING_PASSPHRASE }}" > passphrase.staging.txt
63+
pulumi login gs://mcp-registry-staging-pulumi-state
64+
PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.staging.txt pulumi cancel --stack gcpStaging --yes
65+
66+
- name: Cancel Pulumi Lock (Production)
67+
if: inputs.environment == 'production'
68+
working-directory: ./deploy
69+
run: |
70+
echo "${{ secrets.PULUMI_PROD_PASSPHRASE }}" > passphrase.prod.txt
71+
pulumi login gs://mcp-registry-prod-pulumi-state
72+
PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi cancel --stack gcpProd --yes

0 commit comments

Comments
 (0)