diff --git a/.ci/delete-token.sh b/.ci/delete-token.sh deleted file mode 100755 index d0fcb55..0000000 --- a/.ci/delete-token.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -e -token=$1 -curl -A 'ipxe-ca' --header 'Authorization: Bearer '"$TTS_TOKEN"'' -X DELETE https://tt-service.hetzner.cloud/token?token=''"$token"'' diff --git a/.ci/get-token.sh b/.ci/get-token.sh deleted file mode 100755 index 7674054..0000000 --- a/.ci/get-token.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e -resp=$(curl -A 'ipxe-ca' --header 'Authorization: Bearer '"$TTS_TOKEN"'' -X POST https://tt-service.hetzner.cloud/token -o resp.json) -if grep -q token "resp.json" -then - token=$(cat resp.json | jq -r '.token') - echo $token -else - exit 1 -fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 654ff86..fefa9f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,11 @@ jobs: molecule: name: Molecule + + permissions: + # Required for hetznercloud/tps-action + id-token: write + runs-on: ubuntu-latest steps: - name: Checkout @@ -40,11 +45,13 @@ jobs: - name: Install ansible and molecule run: pip3 install ansible molecule-hetznercloud + - uses: hetznercloud/tps-action@main + with: + token: ${{ secrets.HCLOUD_TOKEN }} + - name: Run molecule run: | - export HCLOUD_TOKEN=$(./.ci/get-token.sh) molecule test - ./.ci/delete-token.sh ${HCLOUD_TOKEN} env: TTS_TOKEN: ${{ secrets.TTS_TOKEN }} PY_COLORS: '1'