Skip to content

Cron File Sync

Cron File Sync #34

name: Cron File Sync
on:
workflow_dispatch:
schedule:
- cron: "0 12 */2 * *" # noon every other day
permissions:
contents: write
pull-requests: write
env:
BRANCH: "sync-${{ github.sha }}"
jobs:
# This job just grabs the latest commits (if any) and creates a PR with the changes
# if there are no changes, no PR
# Another action will handle the PR verification for builds
file-sync:
runs-on: ubuntu-latest
steps:
# TODO: switch to shared composit actions in the future?
# From verify deployments workflow
- uses: actions/checkout@v4
- name: Check for PAT
run: |
if [ -z "${{ secrets.GIT_WORKFLOW_PAT }}" ]; then
echo "Please set the GIT_WORKFLOW_PAT secret to support PR workflow runs on generate"
exit 1
fi
- name: grab latest commits
run: make latest-commits
# exits if there are no changes
- uses: peter-evans/[email protected]
with:
base: main
branch: ${{ env.BRANCH }}
title: "chore: update upstream docs"
commit-message: "chore: sync latest"
delete-branch: true
signoff: false
# https://github.com/orgs/community/discussions/55906#discussioncomment-5946239
# https://github.com/settings/personal-access-tokens/new
# To verify the PR, we must set a PAT token in the secrets
token: ${{ secrets.GIT_WORKFLOW_PAT }}
# https://github.com/interchainio/dev-portal-docsite/issues/labels
labels: |
automated pr
# TODO: codeowners/group in the future w/ team-reviewers
# assignees: reecepbcups
# reviewers: reecepbcups
body: |
Syncing the latest file commits from upstream.