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

CI: Add cron workflow for gTLD update PRs, deprecate tld-update-bot. #513

Merged
merged 1 commit into from
Nov 30, 2020
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
46 changes: 46 additions & 0 deletions .github/workflows/tld-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: tld-update
on:
schedule:
# Run every hour, at the 15 minute mark. E.g.
# 2020-11-29 00:15:00 UTC, 2020-11-29 01:15:00 UTC, 2020-11-29 02:15:00 UTC
- cron: '15 * * * *'
jobs:
zlint-gtld-update:
name: Check for TLD data updates
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.15

- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S %Z')" >> $GITHUB_ENV

- name: Install zlint-gtld-update
run: go install ./cmd/zlint-gtld-update/...
working-directory: v3

- name: Run go-generate
run: go generate ./...
working-directory: v3

- name: Create pull-request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
commit-message: "util: gtld_map autopull updates for ${{ env.NOW }}"
title: "util: gtld_map autopull updates for ${{ env.NOW }}"
body: "ZLint gTLD data updates from `go generate ./...` for ${{ env.NOW }}."
labels: tld-update
branch: zlint-gtld-update
cpu marked this conversation as resolved.
Show resolved Hide resolved
delete-branch: true

- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"