Skip to content

Commit 4588463

Browse files
committed
simplify artifact exist check
1 parent a6cb616 commit 4588463

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

.github/workflows/build-msi.yaml

+8-10
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,20 @@ jobs:
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

19-
- name: Install GitHub CLI
20-
run: |
21-
choco install gh --yes
19+
- name: Check msi_version
20+
uses: softwareforgood/check-artifact-v4-existence@v0
21+
id: "check_if_msi_exists"
22+
with:
23+
name: agent-${{ github.event.inputs.msi_version }}
2224

23-
# Step 3: Only needed while we provide manual versions
24-
- name: Check for existing version
25+
- name: Error if msi exists
26+
if: "${{ steps.check_if_msi_exists.outputs.exists == 'true' }}"
2527
shell: bash
2628
run: |
27-
if gh release view | grep "agent-${{ github.event.inputs.msi_version }}.msi"; then
2829
echo "Error: An artifact with version '${{ github.event.inputs.msi_version }}' already exists. Please increment the version."
2930
exit 1
30-
fi
31-
env:
32-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3331
3432
- name: Set up Go
3533
uses: actions/setup-go@v4

0 commit comments

Comments
 (0)