Skip to content

Commit 2eeff71

Browse files
authored
repo sync
2 parents d87ac23 + aea1912 commit 2eeff71

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

.github/allowed-actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = [
3131
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
3232
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
3333
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
34-
'repo-sync/pull-request@ea6773388b83b337e4da9a223293309f2c3670e7',
34+
'repo-sync/pull-request@58af525d19d3c2b4f744d3348c6823b6340a4921',
3535
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
3636
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0'
3737
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Repo Freeze Reminders
2+
3+
on:
4+
schedule:
5+
- cron: "00 11 * * *" # once per day around 11:00am UTC
6+
7+
env:
8+
FREEZE: ${{ secrets.FREEZE }}
9+
10+
jobs:
11+
check-freezer:
12+
name: Remind about deployment freezes
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
- name: Send Slack notification if repo is frozen
17+
if: ${{ env.FREEZE == 'true' }}
18+
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
19+
env:
20+
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
21+
SLACK_USERNAME: docs-repo-sync
22+
SLACK_ICON_EMOJI: ':freezing_face:'
23+
SLACK_COLOR: '#51A0D5' # Carolina Blue
24+
SLACK_MESSAGE: All repo-sync runs will fail for ${{ github.repository }} because the repo is currently frozen!

.github/workflows/repo-sync.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ env:
1414
FREEZE: ${{ secrets.FREEZE }}
1515

1616
jobs:
17-
repo-sync:
18-
name: Repo Sync
17+
check-freezer:
18+
name: Check for deployment freezes
1919
runs-on: ubuntu-latest
2020
steps:
2121

@@ -25,6 +25,12 @@ jobs:
2525
echo 'The repo is currently frozen! Exiting this workflow.'
2626
exit 1 # prevents further steps from running
2727
28+
repo-sync:
29+
name: Repo Sync
30+
needs: check-freezer
31+
runs-on: ubuntu-latest
32+
steps:
33+
2834
- name: Check out repo
2935
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
3036

@@ -39,7 +45,7 @@ jobs:
3945
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
4046

4147
- name: Create pull request
42-
uses: repo-sync/pull-request@ea6773388b83b337e4da9a223293309f2c3670e7
48+
uses: repo-sync/pull-request@58af525d19d3c2b4f744d3348c6823b6340a4921
4349
env:
4450
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
4551
with:
@@ -56,6 +62,7 @@ jobs:
5662
with:
5763
github-token: ${{ secrets.GITHUB_TOKEN }}
5864
branch: repo-sync
65+
base: main
5966

6067
- name: Approve pull request
6168
if: ${{ steps.find-pull-request.outputs.number }}
@@ -66,7 +73,10 @@ jobs:
6673

6774
- name: Send Slack notification if workflow fails
6875
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
69-
if: failure()
76+
if: ${{ failure() }}
7077
env:
7178
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
79+
SLACK_USERNAME: docs-repo-sync
80+
SLACK_ICON_EMOJI: ':ohno:'
81+
SLACK_COLOR: '#B90E0A' # Crimson
7282
SLACK_MESSAGE: The last repo-sync run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions?query=workflow%3A%22Repo+Sync%22

0 commit comments

Comments
 (0)