From 2ac07506678bb33d9f55969bd1be2cb37eccdbb5 Mon Sep 17 00:00:00 2001 From: Curt Bushko Date: Mon, 17 Apr 2023 14:36:35 -0400 Subject: [PATCH 1/2] Add a cleanup cron job --- .github/workflows/nightly-cleanup.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/nightly-cleanup.yml diff --git a/.github/workflows/nightly-cleanup.yml b/.github/workflows/nightly-cleanup.yml new file mode 100644 index 0000000000..7fc5bd2223 --- /dev/null +++ b/.github/workflows/nightly-cleanup.yml @@ -0,0 +1,27 @@ +# Dispatch to the consul-k8s-workflows with a nightly cron +name: nightly-cleanup +on: + schedule: + # * is a special character in YAML so you have to quote this string + # Run nightly at 12PM UTC/8AM EST/5AM PST + - cron: '0 12 * * *' + +# these should be the only settings that you will ever need to change +env: + CONSUL_IMAGE: hashicorppreview/consul-enterprise:1.16-dev # Consul's enterprise version to use in tests + BRANCH: ${{ github.ref_name }} + CONTEXT: "nightly" + +jobs: + cleanup: + name: cleanup + runs-on: ubuntu-latest + steps: + - uses: benc-uk/workflow-dispatch@v1.2.2 + name: cleanup + with: + workflow: cleanup.yml + repo: hashicorp/consul-k8s-workflows + ref: main + token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} + inputs: '{ "context":"${{ env.CONTEXT }}", "repository":"${{ github.repository }}", "branch":"${{ env.BRANCH }}", "sha":"${{ github.sha }}", "token":"${{ secrets.ELEVATED_GITHUB_TOKEN }}", "consul-image":"${{ env.CONSUL_IMAGE }}" }' From 89be65504067522d0aa336a1a034e9a0b77c575a Mon Sep 17 00:00:00 2001 From: Curt Bushko Date: Mon, 17 Apr 2023 14:39:09 -0400 Subject: [PATCH 2/2] We do not use the CONSUL_IMAGE --- .github/workflows/nightly-cleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-cleanup.yml b/.github/workflows/nightly-cleanup.yml index 7fc5bd2223..79360e497d 100644 --- a/.github/workflows/nightly-cleanup.yml +++ b/.github/workflows/nightly-cleanup.yml @@ -8,7 +8,7 @@ on: # these should be the only settings that you will ever need to change env: - CONSUL_IMAGE: hashicorppreview/consul-enterprise:1.16-dev # Consul's enterprise version to use in tests + CONSUL_IMAGE: "not used" BRANCH: ${{ github.ref_name }} CONTEXT: "nightly"