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

Add kubeconfig for linting workflow template #84

Merged
merged 1 commit into from
May 20, 2022
Merged
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
37 changes: 20 additions & 17 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down Expand Up @@ -49,33 +49,36 @@ jobs:
# Test installation
argo version

# Make fake kubeconfig for executing argo cli
- name: Make fake kubeconfig
# Make kubeconfig for executing argo cli
- name: Make kubeconfig
env:
CLUSTER_CA: ${{ secrets.TEST_CLUSTER_CA }}
CLUSTER_URL: ${{ secrets.TEST_CLUSTER_URL }}
run: |
cat <<EOF > /tmp/fakekubeconfig
cat <<EOF > /tmp/kubeconfig
apiVersion: v1
kind: Config
clusters:
- cluster:
certificate-authority-data: ZHVtbXkK
server: https://localhost:6443
name: dummy
certificate-authority-data: $CLUSTER_CA
server: $CLUSTER_URL
name: tks-cicd
zugwan marked this conversation as resolved.
Show resolved Hide resolved
contexts:
- context:
cluster: dummy
user: dummy
name: dummy
current-context: dummy
cluster: tks-cicd
user: argo
name: argo@tks-cicd
current-context: argo@tks-cicd
kind: Config
preferences: {}
users:
- name: dummy
- name: argo
user:
username: dummy
password: dummy
username: test
password: test
EOF
cat /tmp/fakekubeconfig
cat /tmp/kubeconfig

# Runs a Lint command
- name: Lint changed file
run: |
argo template lint --kubeconfig /tmp/fakekubeconfig ${{ steps.changed-files.outputs.all_changed_files }}
argo template lint --kubeconfig /tmp/kubeconfig ${{ steps.changed-files.outputs.all_changed_files }}