Skip to content

Commit 9077237

Browse files
authored
Merge pull request #1065 from GitGuardian/severine/trigger-vscode-release
chore(ci): automatically open PR on VSCode Extension repo upon release
2 parents 3ff4303 + a25a08d commit 9077237

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.github/workflows/tag.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ jobs:
8282
packages/ggshield-*.zip \
8383
packages/ggshield-*.gz
8484
85+
- name: Update VSCode extension
86+
uses: ./.github/workflows/update_vscode_extension.yml
87+
with:
88+
version: ${{ steps.tags.outputs.tag }}
89+
secrets: inherit
90+
8591
push_to_docker_hub:
8692
name: Push Docker image to Docker Hub
8793
runs-on: ubuntu-22.04
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Update VSCode Extension
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to update to'
8+
required: true
9+
type: string
10+
workflow_call:
11+
inputs:
12+
version:
13+
description: 'Version to update to'
14+
required: true
15+
type: string
16+
17+
jobs:
18+
update-ggshield-version:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout VSCode extension repo
22+
uses: actions/checkout@v4
23+
with:
24+
repository: GitGuardian/gitguardian-vscode
25+
token: ${{ secrets.PAT_GITHUB }}
26+
sparse-checkout: |
27+
ggshield_version
28+
sparse-checkout-cone-mode: false
29+
30+
- name: Create branch
31+
run: |
32+
git config --global user.name 'GitHub Actions'
33+
git config --global user.email '[email protected]'
34+
git checkout -b update-ggshield-to-${{ inputs.version }}
35+
36+
- name: Update ggshield_version file
37+
run: |
38+
version="${{ inputs.version }}"
39+
version="${version#v}" # Remove leading 'v' if present
40+
echo "$version" > ggshield_version
41+
42+
- name: Commit changes
43+
run: |
44+
git add ggshield_version
45+
git commit -m "Update ggshield version to ${{ inputs.version }}"
46+
47+
- name: Push changes
48+
run: |
49+
git push --set-upstream origin update-ggshield-to-${{ inputs.version }} --force
50+
51+
- name: Create pull request
52+
env:
53+
GH_TOKEN: ${{ secrets.PAT_GITHUB }}
54+
run: |
55+
gh pr create \
56+
--repo GitGuardian/gitguardian-vscode \
57+
--title "Update ggshield version to ${{ inputs.version }}" \
58+
--body "This PR updates the bundled ggshield CLI to version ${{ inputs.version }}. This update was automatically generated by a worflow on ggshield repository." \
59+
--base main \
60+
--head update-ggshield-to-${{ inputs.version }}

0 commit comments

Comments
 (0)