Skip to content

cronjob

cronjob #1561

Workflow file for this run

name: cronjob
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
permissions:
contents: write
pull-requests: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: '1.20.3'
- name: Setup latest Terraform
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_wrapper: false
- name: Remove generated directory
run: rm -rf generated
- name: Run go mod tidy
run: go mod tidy
- name: refresh and test
run: |
export VERSION=$(go run cmd/main.go -refresh)
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
go mod tidy
go test github.com/${{ github.repository }}/v5/generated/...
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: git commit
run: |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
go run cmd/main.go -commit=$VERSION