Skip to content

Commit ffc7dce

Browse files
authored
Update site-policy-sync.yml
1 parent ec3ee73 commit ffc7dce

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/site-policy-sync.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: site-policy-sync
22

3-
# **What it does**: Updates our site policy docs when changes happen to site policy.
4-
# **Why we have it**: We want up to date site policy docs.
5-
# **Who does it impact**: Site policy team.
3+
# **What it does**: Updates our site-policy repo when changes happen to site policy docs.
4+
# **Why we have it**: We want keep site-policy repo up to date.
5+
# **Who does it impact**: Site-policy team.
66

77
# Controls when the action will run.
88
on:
@@ -30,6 +30,19 @@ jobs:
3030
steps:
3131
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3232
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
33+
# Sets commit message
34+
- name: default message
35+
run: |
36+
echo "MESSAGE=Automatic sync with changes from GitHub Docs" >> $GITHUB_ENV
37+
- name: custom message
38+
if: contains(github.event.pull_request.body, '### Public summary for site-policy changes:')
39+
run: |
40+
NEW=$(echo $MESSAGE | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g')
41+
NEW2=$(echo $NEW | sed 's/^.*### Public summary for site-policy changes://')
42+
echo MESSAGE=$NEW2 >> $GITHUB_ENV
43+
env:
44+
MESSAGE: >
45+
${{github.event.pull_request.body}}
3346
3447
# Pushes to other repo
3548
- name: Push folder to another repository
@@ -44,4 +57,4 @@ jobs:
4457
destination_folder: 'Policies'
4558
user_email: 'pcihon@users.noreply.github.com'
4659
user_name: 'pcihon'
47-
commit_msg: 'Automatic sync from GitHub Docs.'
60+
commit_msg: '${{ env.MESSAGE }}'

0 commit comments

Comments
 (0)