12 Commits

Author SHA1 Message Date
Aarnav Tale
25403f865e fix: move to /tmp/bin for kubectl location 2023-01-06 12:31:02 -05:00
Aarnav Tale
f6e83f6681 chore: bump default version to 1.26 2023-01-06 12:25:02 -05:00
Aarnav Tale
b88fbf4ad6 chore: bump default kubectl version to 1.25.0 2022-09-04 11:54:55 -04:00
Aarnav Tale
fe5edd2387 feat: revert back to original system 2022-06-27 03:13:27 -04:00
Aarnav Tale
50d08134cc fix: use printf instead of cat 2022-06-27 03:09:11 -04:00
Aarnav Tale
1c88fc9f2b fix: actually write to file on b64 2022-06-27 03:04:28 -04:00
Aarnav Tale
16b4bea4f4 fix: workaround github actions not decoding properly 2022-06-27 02:50:47 -04:00
Aarnav Tale
34de7de05e fix: kubectl version is now properly set 2022-06-27 02:34:59 -04:00
Aarnav Tale
f326ba7d79 fix: add scripts to github actions path 2022-05-14 22:50:16 -04:00
Aarnav Tale
7ba18097f4 chore: revert to v1 tag 2022-04-07 10:14:43 -04:00
Aarnav Tale
192e5a2aa5 fix: make scripts executable 2022-04-07 10:14:17 -04:00
Aarnav Tale
a17bf21ca2 fix: use correct action tag 2022-04-07 10:11:09 -04:00
4 changed files with 13 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ To use this action, add the following step to your GitHub Action workflow:
Keep in mind that the action expects a base64 encoded string of your Kubernetes configuration. The simplest way to do that is to run `cat $HOME/.kube/config | base64` and save that output as an action secret.
It's also possible to specify the version of the [kubectl](https://kubernetes.io/docs/reference/kubectl/) CLI to use. The current default release used by this action is `v1.23.0`.
It's also possible to specify the version of the [kubectl](https://kubernetes.io/docs/reference/kubectl/) CLI to use. The current default release used by this action is `v1.26.0`.
```yaml
- uses: tale/kubectl-action@v1
with:

View File

@@ -8,16 +8,20 @@ inputs:
kubectl-version:
description: Version of the kubectl CLI to use
required: false
default: v1.23.0
default: v1.26.0
base64-kube-config:
description: A base64 encoded reference to your authorization file (~/.kube/config)
required: true
runs:
using: composite
steps:
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- name: Configure kubectl CLI
run: setup-kubectl.sh
shell: bash
env:
KUBECTL_VERSION: ${{ inputs.kubectl-version }}
- name: Authorize kubectl to the cluster
run: login-kubectl.sh
shell: bash

0
login-kubectl.sh Normal file → Executable file
View File

13
setup-kubectl.sh Normal file → Executable file
View File

@@ -1,9 +1,10 @@
#!/usr/bin/env bash
curl -LO "https://dl.k8s.io/release/${{ inputs.kubectl-version }}/bin/linux/amd64/kubectl"
curl -LO "https://dl.k8s.io/${{ inputs.kubectl-version }}/bin/linux/amd64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
curl -LO "https://dl.k8s.io/$KUBECTL_VERSION/bin/linux/amd64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
rm -f kubectl.sha256
mkdir $GITHUB_WORKSPACE/bin
mv kubectl $GITHUB_WORKSPACE/bin
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
mkdir -p $RUNNER_TEMP/bin
mv kubectl $RUNNER_TEMP/bin
echo "$RUNNER_TEMP/bin" >> $GITHUB_PATH