Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo sync #767

Merged
merged 1 commit into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/allowed-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = [
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
'repo-sync/pull-request@ea6773388b83b337e4da9a223293309f2c3670e7',
'repo-sync/pull-request@58af525d19d3c2b4f744d3348c6823b6340a4921',
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0'
]
24 changes: 24 additions & 0 deletions .github/workflows/repo-freeze-reminders.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Repo Freeze Reminders

on:
schedule:
- cron: "00 11 * * *" # once per day around 11:00am UTC

env:
FREEZE: ${{ secrets.FREEZE }}

jobs:
check-freezer:
name: Remind about deployment freezes
runs-on: ubuntu-latest
steps:

- name: Send Slack notification if repo is frozen
if: ${{ env.FREEZE == 'true' }}
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
env:
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
SLACK_USERNAME: docs-repo-sync
SLACK_ICON_EMOJI: ':freezing_face:'
SLACK_COLOR: '#51A0D5' # Carolina Blue
SLACK_MESSAGE: All repo-sync runs will fail for ${{ github.repository }} because the repo is currently frozen!
18 changes: 14 additions & 4 deletions .github/workflows/repo-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ env:
FREEZE: ${{ secrets.FREEZE }}

jobs:
repo-sync:
name: Repo Sync
check-freezer:
name: Check for deployment freezes
runs-on: ubuntu-latest
steps:

Expand All @@ -25,6 +25,12 @@ jobs:
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running

repo-sync:
name: Repo Sync
needs: check-freezer
runs-on: ubuntu-latest
steps:

- name: Check out repo
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675

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

- name: Create pull request
uses: repo-sync/pull-request@ea6773388b83b337e4da9a223293309f2c3670e7
uses: repo-sync/pull-request@58af525d19d3c2b4f744d3348c6823b6340a4921
env:
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
with:
Expand All @@ -56,6 +62,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: repo-sync
base: main

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

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