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

chore: Add nightly sync for CFA orgs #830

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
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
35 changes: 35 additions & 0 deletions .github/workflows/sync-cfa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run CFA fetch

on:
schedule:
- cron: "0 0 * * *" # Run nightly at midnight

jobs:
build:

runs-on: ubuntu-latest
if: github.repository_owner == "github"

steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Setup Dependencies
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Fetch latest CFA changes
run: bundle exec script/fetch-cfa
- name: Ensure that all are still orgs
run: bundle exec script/ensure-orgs
- name: Alphabetize changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If any of the above fail, say network failures, does the below automatically push a commit deleting all civic hacking orgs? Or does processing stop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Process should stop, because "continue on error" isn't set on any of them

run: bundle exec script/alphabetize
- name: Push back changes
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "generated" || true
git push