Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

Commit b089619

Browse files
Convert hashicorp/terraform-helm to GitHub Actions (#67)
* Adding workflow .github/workflows/test.yml .github/workflows/update-helm-charts-index.yml * SHA-pin all 3rd-party actions * Restrict workflow permissions * Add actionslint * Add dependabot * Add CODEOWNERS * Update test workflow Signed-off-by: Scott Macfarlane <[email protected]> * WIP: update chart publish Signed-off-by: Scott Macfarlane <[email protected]> * Enable slack notification on failure Signed-off-by: Scott Macfarlane <[email protected]> * Use GH_TOKEN env var for gh cli to not squash GITHUB_TOKEN Signed-off-by: Scott Macfarlane <[email protected]> * Constrain actionlint to run only on changes to workflows Signed-off-by: Scott Macfarlane <[email protected]> * Correct actions-slack-status keys Signed-off-by: Scott Macfarlane <[email protected]> * Remove circleci configuration Signed-off-by: Scott Macfarlane <[email protected]> --------- Signed-off-by: Scott Macfarlane <[email protected]> Co-authored-by: Scott Macfarlane <[email protected]>
1 parent bd954ab commit b089619

File tree

5 files changed

+85
-62
lines changed

5 files changed

+85
-62
lines changed

.circleci/config.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"

.github/workflows/actionlint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# If the repository is public, be sure to change to GitHub hosted runners
2+
name: Lint GitHub Actions Workflows
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/**
7+
permissions:
8+
contents: read
9+
jobs:
10+
actionlint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
14+
- name: "Check workflow files"
15+
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint:latest

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: hashicorp/terraform-helm/test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
unit:
12+
runs-on: ubuntu-latest
13+
container:
14+
image: docker.mirror.hashicorp.services/hashicorpdev/terraform-helm-test:0.1.0
15+
steps:
16+
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
17+
- name: Run Unit Tests
18+
run: bats ./test/unit
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: update-helm-charts-index
2+
on:
3+
push:
4+
tags:
5+
- "v.*"
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
update-helm-charts-index:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
15+
16+
- name: verify Chart version matches tag version
17+
env:
18+
ref_name: ${{ github.ref_name }}
19+
run: |-
20+
chart_tag="$(yq '.version' Chart.yaml)"
21+
git_tag="${ref_name#v}"
22+
if [ "${git_tag}" != "${chart_tag}" ]; then
23+
message="chart version (${chart_tag}) did not match git version (${git_tag})"
24+
echo "::error title=Version Mismatch::${message}"
25+
echo "${message}"
26+
exit 1
27+
fi
28+
29+
- name: update helm-charts index
30+
env:
31+
GH_TOKEN: ${{ secrets.HELM_CHARTS_GITHUB_TOKEN }}
32+
run: |-
33+
./bin/gh workflow run publish-charts.yml \
34+
--repo hashicorp/helm-charts \
35+
--ref main \
36+
-f SOURCE_TAG="${{ github.ref_name }}" \
37+
-f SOURCE_REPO="${{ github.repository }}"
38+
39+
- name: send slack status
40+
if: failure()
41+
uses: hashicorp/actions-slack-status@v1
42+
with:
43+
status: "failure"
44+
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK }}
45+
failure-message: "Failed to trigger an update to the helm charts index."

0 commit comments

Comments
 (0)