Skip to content

Commit 8061bb7

Browse files
Use Git LFS for wrapper update
1 parent aca6bea commit 8061bb7

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

.github/workflows/update-cli.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@ jobs:
88
update-checkmarx-cli:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3.5.2
11+
- uses: actions/checkout@v4.1.7
12+
with:
13+
lfs: true
14+
15+
- name: Install Git LFS
16+
run: git lfs install
17+
18+
- name: Configure Git user
19+
run: |
20+
git config --global user.name github-actions[bot]
21+
git config --global user.email github-actions[bot]@users.noreply.github.com
22+
1223
- name: Get Latest Checkmarx Java wrapper version
1324
id: ast-cli-java-wrapper
1425
run: |
@@ -27,9 +38,26 @@ jobs:
2738
cd checkmarx-ast-eclipse-plugin/lib/
2839
rm -rf "$current_version"
2940
curl "https://repo1.maven.org/maven2/com/checkmarx/ast/ast-cli-java-wrapper/${{ steps.ast-cli-java-wrapper.outputs.release_tag }}/${new_version}" --output $new_version
41+
42+
# Track the new JAR file with LFS
43+
FILE_PATH="checkmarx-ast-eclipse-plugin/lib/$new_version" # Correct path
44+
# Create the directory if it doesn't exist (important!)
45+
mkdir -p "checkmarx-ast-eclipse-plugin/lib"
46+
mv $new_version $FILE_PATH
47+
# Ensure the file exists after download
48+
if [ ! -f "$FILE_PATH" ]; then
49+
echo "Error: File $FILE_PATH not found after download."
50+
exit 1 # Fail the workflow
51+
fi
52+
git lfs track "$FILE_PATH"
53+
git add .gitattributes
54+
git add "$FILE_PATH"
55+
git commit -m "Update ast-cli-java-wrapper to ${{ steps.ast-cli-java-wrapper.outputs.release_tag }}"
56+
git push origin HEAD:${{ github.ref }}
57+
3058
- name: Create Pull Request
3159
if: steps.ast-cli-java-wrapper.outputs.current_tag != steps.ast-cli-java-wrapper.outputs.release_tag
32-
uses: peter-evans/create-pull-request@v5
60+
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6.1.0
3361
with:
3462
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
3563
commit-message: Update ast-cli-java-wrapper to ${{ steps.ast-cli-java-wrapper.outputs.release_tag }}

0 commit comments

Comments
 (0)