forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (47 loc) · 1.89 KB
/
site-policy-sync.yml
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
name: site-policy-sync
# **What it does**: Updates our site-policy repo when changes happen to site policy docs.
# **Why we have it**: We want keep site-policy repo up to date.
# **Who does it impact**: Site-policy team.
# Controls when the action will run.
on:
# Triggers the workflow pull requests merged to the main branch
pull_request:
branches:
- main
types:
- closed
paths:
- 'content/github/site-policy/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
copy-file:
if: >-
github.event.pull_request.merged == true &&
github.repository == 'github/docs-internal'
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
# Sets commit message
- name: custom message
run: |
echo "MESSAGE=${{github.event.pull_request.title}}" >> $GITHUB_ENV
# Pushes to other repo
- name: Push folder to another repository
uses: crykn/copy_folder_to_another_repo_action@0282e8b9fef06de92ddcae9fe6cb44df6226646c
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_SITEPOLICY }}
with:
source_folder: 'content/github/site-policy'
destination_repo: 'github/site-policy'
destination_branch: 'main'
destination_branch_create: 'repo-sync'
destination_folder: 'Policies'
user_email: '[email protected]'
user_name: 'site-policy-bot'
commit_msg: '${{ env.MESSAGE }}'