-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (49 loc) · 1.84 KB
/
cron-latest-commits.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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.