Skip to content

Commit

Permalink
feat(github-actions): create org-file-sync action
Browse files Browse the repository at this point in the history
Create an org-file-sync action which allows for automatically synchronizing organization level files
from the `.github` directory with target repositories automatically.

The angular-robot Github app will automatically push changes to keep the registered files in sync.
  • Loading branch information
josephperrott committed Jun 30, 2022
1 parent 73d4292 commit 4abbb11
Show file tree
Hide file tree
Showing 6 changed files with 15,795 additions and 0 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ github-actions/lock-closed/main.js
github-actions/commit-message-based-labels/main.js
github-actions/slash-commands/main.js
github-actions/post-approval-changes/main.js
github-actions/org-file-sync/main.js
.github/local-actions/changelog/main.js

bazel/map-size-tracking/test/size-golden.json
27 changes: 27 additions & 0 deletions github-actions/org-file-sync/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("//tools:defaults.bzl", "esbuild_checked_in", "ts_library")

package(default_visibility = ["//github-actions/org-file-sync:__subpackages__"])

ts_library(
name = "org-file-sync",
srcs = glob(
["src/*.ts"],
),
deps = [
"//github-actions:utils",
"@npm//@actions/core",
"@npm//@actions/github",
"@npm//@octokit/rest",
"@npm//@octokit/types",
"@npm//@types/node",
],
)

esbuild_checked_in(
name = "main",
entry_point = ":src/main.ts",
target = "node16",
deps = [
":org-file-sync",
],
)
9 changes: 9 additions & 0 deletions github-actions/org-file-sync/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Organization File Sync

This directory contains an action which can be executed in the `.github` repository. Based on the
configured list of files and repositories, the action will ensure the all of the provided files in
the provided repositories are kept in sync with the `.github` repository.

## License

MIT
17 changes: 17 additions & 0 deletions github-actions/org-file-sync/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Organization File Sync'
description: 'Synchronize files throughout the Github Organization'
author: 'Angular'
inputs:
angular-robot-key:
description: 'The private key for the Angular Robot Github app.'
required: true
repos:
description: 'The repositories to keep organization level files in sync'
required: true
files:
description: 'The organization level files to keep in sync'
required: true

runs:
using: 'node16'
main: 'main.js'
Loading

0 comments on commit 4abbb11

Please sign in to comment.