Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): remove redundant ${{ ... }} in if statements in workflows #4517

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/_conformance_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
KONG_TEST_EXPRESSION_ROUTES: ${{ matrix.expression_routes }}

- name: collect test report
if: ${{ always() }}
if: always()
uses: actions/upload-artifact@v3
with:
name: tests-report
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_docker_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fetch-depth: 0

- name: Parse semver string
if: ${{ inputs.tag != '' }}
if: inputs.tag != ''
id: parse-semver-tag
uses: booxmedialtd/ws-action-parse-semver@v1.4.7
with:
Expand All @@ -53,7 +53,7 @@ jobs:

- name: Add major.minor tag
id: add-major-minor-tag
if: ${{ steps.parse-semver-tag.outputs.prerelease == '' }}
if: steps.parse-semver-tag.outputs.prerelease == ''
run: |
echo "tag=type=raw,value=${{ steps.parse-semver-tag.outputs.major }}.${{ steps.parse-semver-tag.outputs.minor }}" >> $GITHUB_OUTPUT

Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/_e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ jobs:
test: ${{ fromJSON(needs.setup-e2e-tests.outputs.test_names) }}
steps:
- name: Download built image artifact
if: ${{ inputs.load-local-image }}
if: inputs.load-local-image
uses: actions/download-artifact@v3
with:
name: kic-image
path: /tmp

- name: Load built image
if: ${{ inputs.load-local-image }}
if: inputs.load-local-image
run: |
docker load --input /tmp/image.tar
docker image ls -a
Expand All @@ -123,7 +123,7 @@ jobs:
# image which is available in the external container image registry but not
# locally and that fails.
- name: Pull Gateway image for tests
if: ${{ inputs.kong-image != '' && inputs.load-local-image }}
if: inputs.kong-image != '' && inputs.load-local-image
run: docker pull ${{ inputs.kong-image }}

- name: run ${{ matrix.test }}
Expand All @@ -139,7 +139,7 @@ jobs:
GOTESTSUM_JUNITFILE: "e2e-${{ matrix.test }}${{ matrix.kubernetes-version }}-tests.xml"

- name: upload diagnostics
if: ${{ always() }}
if: always()
uses: actions/upload-artifact@v3
with:
name: "diagnostics-e2e-tests-${{ matrix.test }}-${{ matrix.kubernetes-version }}"
Expand All @@ -153,7 +153,7 @@ jobs:
path: "*-tests.xml"

gke:
if: ${{ inputs.run-gke }}
if: inputs.run-gke
environment: "gcloud"
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
GOOGLE_LOCATION: ${{ secrets.GOOGLE_LOCATION }}

- name: upload diagnostics
if: ${{ always() }}
if: always()
uses: actions/upload-artifact@v3
with:
name: "diagnostics-e2e-gke-tests-${{ matrix.test }}-${{ matrix.kubernetes-version }}"
Expand All @@ -216,7 +216,7 @@ jobs:
path: "*-tests.xml"

istio:
if: ${{ inputs.run-istio }}
if: inputs.run-istio
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -232,14 +232,14 @@ jobs:
istio-version: 'v1.15'
steps:
- name: Download built image artifact
if: ${{ inputs.load-local-image }}
if: inputs.load-local-image
uses: actions/download-artifact@v3
with:
name: kic-image
path: /tmp

- name: Load built image
if: ${{ inputs.load-local-image }}
if: inputs.load-local-image
run: |
docker load --input /tmp/image.tar
docker image ls -a
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
GOTESTSUM_JUNITFILE: "istio-${{ matrix.kubernetes-version }}-${{ matrix.istio-version }}-tests.xml"

- name: upload diagnostics
if: ${{ always() }}
if: always()
uses: actions/upload-artifact@v3
with:
name: diagnostics-e2e-tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_test_reports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

jobs:
coverage:
if: ${{ inputs.coverage && !cancelled() }}
if: inputs.coverage && !cancelled()
runs-on: ubuntu-latest
steps:
- name: checkout repository
Expand All @@ -43,7 +43,7 @@ jobs:
verbose: true

buildpulse-report:
if: ${{ inputs.buildpulse && !cancelled() }}
if: inputs.buildpulse && !cancelled()
runs-on: ubuntu-latest
steps:
- name: checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
path: coverage.unit.out

- name: collect test report
if: ${{ always() }}
if: always()
uses: actions/upload-artifact@v3
with:
name: tests-report
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e_targeted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:

jobs:
post-comment-in-pr:
if: ${{ github.event.inputs.pr-number != '' }}
if: github.event.inputs.pr-number != ''
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.K8S_TEAM_BOT_GH_PAT }}
Expand All @@ -56,7 +56,7 @@ jobs:
- run: gh pr edit ${PR_NUMBER} --remove-label ci/run-e2e

build-image:
if: ${{ inputs.controller-image == '' }}
if: inputs.controller-image == ''
uses: ./.github/workflows/_docker_build.yaml
secrets: inherit

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: fail if tag already exists
if: ${{ steps.check-tag.outputs.exists == 'true' }}
if: steps.check-tag.outputs.exists == 'true'
run: exit 1
- name: checkout repository
uses: actions/checkout@v3
Expand All @@ -45,7 +45,7 @@ jobs:
input_string: ${{ github.event.inputs.tag }}
version_extractor_regex: 'v(.*)$'
- name: Verify manifests have requested KIC tag
if: ${{ steps.semver_parser.outputs.prerelease == '' }}
if: steps.semver_parser.outputs.prerelease == ''
env:
# We expect the tag used in manifests to be {major}.{minor} part of the version, e.g.
# for v2.10.3 we expect manifests to use 2.10 tag.
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
echo 'type=raw,value=${{ steps.semver_parser.outputs.fullversion }}' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Add major.minor tag
if: ${{ steps.semver_parser.outputs.prerelease == '' }}
if: steps.semver_parser.outputs.prerelease == ''
run: |
echo 'TAGS_SUPPLEMENTAL<<EOF' >> $GITHUB_ENV
echo "" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate_kong_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:

jobs:
startup-issue-comment:
if: ${{ github.event.inputs.issue-number != '' }}
if: github.event.inputs.issue-number != ''
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.K8S_TEAM_BOT_GH_PAT }}
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- startup-issue-comment
- run-e2e-tests
- run-integration-tests
if: ${{ github.event.inputs.issue-number != '' }}
if: github.event.inputs.issue-number != ''
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.K8S_TEAM_BOT_GH_PAT }}
Expand Down