Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gdecicco committed Mar 15, 2024
1 parent 8e65bee commit 1998129
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 28 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/helm-on-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Helm Chart

on:
pull_request:
branches:
- 'main'

permissions:
contents: read

jobs:

changes:
permissions:
contents: read # for dorny/paths-filter to fetch a list of changed files
pull-requests: read # for dorny/paths-filter to read pull requests
runs-on: ubuntu-latest
outputs:
charts: ${{ steps.filter.outputs.charts }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
ct list-changed --target-branch main
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} )
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install

28 changes: 0 additions & 28 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} )
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install

- uses: dorny/[email protected]
id: filter
with:
Expand Down

0 comments on commit 1998129

Please sign in to comment.