Skip to content

Commit 12c458b

Browse files
authored
Merge pull request #7 from javiermolinar/fix-zizmor-issues
fix zizmor issues
2 parents b2a1519 + c5d7509 commit 12c458b

File tree

7 files changed

+47
-17
lines changed

7 files changed

+47
-17
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v5
21+
with:
22+
persist-credentials: false
2123
- uses: actions/setup-go@v6
2224
with:
2325
go-version: ${{ matrix.go-version }}

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v5
16+
with:
17+
persist-credentials: false
1618
- uses: actions/setup-go@v6
1719
with:
1820
go-version: stable

.github/workflows/publish-goland-plugin.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,23 @@ jobs:
3232
steps:
3333
- name: Checkout
3434
uses: actions/checkout@v4
35+
with:
36+
persist-credentials: false
3537

3638
- name: Validate version format
3739
run: |
38-
if [[ "${{ github.ref }}" == refs/tags/goland-v* ]]; then
40+
if [[ "${GITHUB_REF}" == refs/tags/goland-v* ]]; then
3941
VERSION="${GITHUB_REF#refs/tags/goland-v}"
4042
else
41-
VERSION="${{ github.event.inputs.version }}"
43+
VERSION="${GITHUB_EVENT_INPUTS_VERSION}"
4244
fi
4345
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then
4446
echo "::error::Invalid version format: $VERSION (expected: X.Y.Z or X.Y.Z-suffix)"
4547
exit 1
4648
fi
4749
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV
50+
env:
51+
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
4852

4953
- name: Setup Java
5054
uses: actions/setup-java@v4
@@ -56,12 +60,13 @@ jobs:
5660
uses: gradle/actions/setup-gradle@v3
5761
with:
5862
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
63+
cache-disabled: true
5964

6065
- name: Update plugin version
6166
working-directory: ${{ env.PLUGIN_DIR }}
6267
run: |
63-
sed -i "s/^version = \".*\"/version = \"${{ env.PLUGIN_VERSION }}\"/" build.gradle.kts
64-
echo "Updated version to ${{ env.PLUGIN_VERSION }}"
68+
sed -i "s/^version = \".*\"/version = \"${PLUGIN_VERSION}\"/" build.gradle.kts
69+
echo "Updated version to ${PLUGIN_VERSION}"
6570
grep "^version" build.gradle.kts
6671
6772
- name: Build Plugin
@@ -76,8 +81,9 @@ jobs:
7681
working-directory: ${{ env.PLUGIN_DIR }}
7782
env:
7883
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_PUBLISH_TOKEN }}
84+
GITHUB_EVENT_INPUTS_CHANNEL: ${{ github.event.inputs.channel || 'default' }}
7985
run: |
80-
CHANNEL="${{ github.event.inputs.channel || 'default' }}"
86+
CHANNEL="${GITHUB_EVENT_INPUTS_CHANNEL}"
8187
echo "Publishing to channel: $CHANNEL"
8288
./gradlew publishPlugin -PpluginChannel="$CHANNEL"
8389

.github/workflows/release-lsp.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,35 @@ jobs:
2121
steps:
2222
- name: Checkout code
2323
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
2426

2527
- name: Setup Go
2628
uses: actions/setup-go@v5
2729
with:
2830
go-version: '1.21'
29-
cache: true
31+
cache: false
3032

3133
- name: Get version
3234
id: version
3335
run: |
3436
if [ "${{ github.event_name }}" = "release" ]; then
35-
VERSION="${{ github.event.release.tag_name }}"
37+
VERSION="${GITHUB_EVENT_RELEASE_TAG_NAME}"
3638
else
37-
VERSION="${{ github.event.inputs.version }}"
39+
VERSION="${GITHUB_EVENT_INPUTS_VERSION}"
3840
fi
3941
echo "version=$VERSION" >> $GITHUB_OUTPUT
4042
echo "Building version: $VERSION"
43+
env:
44+
GITHUB_EVENT_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
45+
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
4146

4247
- name: Build binaries for all platforms
4348
run: |
4449
chmod +x scripts/build-lsp.sh
45-
./scripts/build-lsp.sh ${{ steps.version.outputs.version }} dist
50+
./scripts/build-lsp.sh ${STEPS_VERSION_OUTPUTS_VERSION} dist
51+
env:
52+
STEPS_VERSION_OUTPUTS_VERSION: ${{ steps.version.outputs.version }}
4653

4754
- name: Generate checksums
4855
run: |

.github/workflows/sync-plugin-version.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
1921

2022
- name: Extract version from main release tag
2123
run: |
@@ -32,12 +34,14 @@ jobs:
3234

3335
- name: Setup Gradle
3436
uses: gradle/actions/setup-gradle@v3
37+
with:
38+
cache-disabled: true
3539

3640
- name: Update plugin version
3741
working-directory: extensions/goland
3842
run: |
39-
sed -i "s/^version = \".*\"/version = \"${{ env.PLUGIN_VERSION }}\"/" build.gradle.kts
40-
echo "Updated GoLand plugin version to ${{ env.PLUGIN_VERSION }}"
43+
sed -i "s/^version = \".*\"/version = \"${PLUGIN_VERSION}\"/" build.gradle.kts
44+
echo "Updated GoLand plugin version to ${PLUGIN_VERSION}"
4145
grep "^version" build.gradle.kts
4246
4347
- name: Build Plugin

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v5
19+
with:
20+
persist-credentials: false
1921
- uses: actions/setup-go@v6
2022
with:
2123
go-version: ${{ matrix.go-version }}

action.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ runs:
4646
- name: Install unqueryvet
4747
shell: bash
4848
run: |
49-
if [ "${{ inputs.version }}" = "latest" ]; then
49+
if [ "${INPUTS_VERSION}" = "latest" ]; then
5050
go install github.com/MirrexOne/unqueryvet/cmd/unqueryvet@latest
5151
else
52-
go install github.com/MirrexOne/unqueryvet/cmd/unqueryvet@${{ inputs.version }}
52+
go install github.com/MirrexOne/unqueryvet/cmd/unqueryvet@${INPUTS_VERSION}
5353
fi
54+
env:
55+
INPUTS_VERSION: ${{ inputs.version }}
5456

5557
- name: Run unqueryvet
5658
id: run
@@ -59,13 +61,13 @@ runs:
5961
run: |
6062
set +e
6163
62-
ARGS="${{ inputs.args }}"
64+
ARGS="${INPUTS_ARGS}"
6365
64-
if [ "${{ inputs.check-n1 }}" = "true" ]; then
66+
if [ "${INPUTS_CHECK_N1}" = "true" ]; then
6567
ARGS="-n1 $ARGS"
6668
fi
6769
68-
if [ "${{ inputs.check-sqli }}" = "true" ]; then
70+
if [ "${INPUTS_CHECK_SQLI}" = "true" ]; then
6971
ARGS="-sqli $ARGS"
7072
fi
7173
@@ -80,7 +82,7 @@ runs:
8082
echo "issues=$ISSUES" >> $GITHUB_OUTPUT
8183
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
8284
83-
if [ "${{ inputs.fail-on-issues }}" = "true" ] && [ $EXIT_CODE -ne 0 ]; then
85+
if [ "${INPUTS_FAIL_ON_ISSUES}" = "true" ] && [ $EXIT_CODE -ne 0 ]; then
8486
echo "::error::Unqueryvet found $ISSUES issues"
8587
exit 1
8688
fi
@@ -90,3 +92,8 @@ runs:
9092
else
9193
echo "::warning::Found $ISSUES SELECT * issues"
9294
fi
95+
env:
96+
INPUTS_ARGS: ${{ inputs.args }}
97+
INPUTS_CHECK_N1: ${{ inputs.check-n1 }}
98+
INPUTS_CHECK_SQLI: ${{ inputs.check-sqli }}
99+
INPUTS_FAIL_ON_ISSUES: ${{ inputs.fail-on-issues }}

0 commit comments

Comments
 (0)