-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add a Github Actions script that synchronizes the template every month. #56
Merged
Merged
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
0e9b021
feat: add sync.yml which runs every month
zyrafal a9fde24
feat: create a pull request
zyrafal 4c71cdf
feat: create add-sync-to-repos.yml
zyrafal 5e80ccd
fix: some typos
zyrafal 0a13430
fix: github token
zyrafal 0a23113
fix: disable substitution
zyrafal 7b80b79
fix: git auth
zyrafal ec92464
fix: uncomment push and pr
zyrafal 547de5f
fix: use sed
zyrafal 426e349
fix: move git config
zyrafal 747d03d
fix: change pr title
zyrafal 9b0e70b
fix: add original_remote variable
zyrafal 3d04254
fix: add debug prints
zyrafal b006f48
fix: remove push
zyrafal f5e88a8
fix: typo
zyrafal 42c69b6
fix: copy the file
zyrafal cf09a00
fix: typo
zyrafal a969b82
fix: typo
zyrafal 626269f
fix: create a branch in this repository
zyrafal 1d9a0dc
fix: typo
zyrafal 7f261f9
fix: add git config url
zyrafal edf90e8
fix: try on this repo
zyrafal ab9d76d
fix: quotes
zyrafal 3174b20
fix: replace repo
zyrafal 63530cc
fix: try forking the repo
zyrafal fddee05
fix: add write permission to sync.yml
zyrafal de08e6f
fix: delete add-sync-to-repos.yml
zyrafal 67f39ba
fix: add pull-requests permission to sync.yml
zyrafal 89a8e54
fix: avoid merge conflicts and rename sync.yml to sync-template.yml
zyrafal b5235dc
Update sync-template.yml
0x4007 4356e5c
feat: add a list of ignored files
zyrafal 89b942e
feat: auth as the bot
zyrafal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Sync branch to template | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '14 0 1 * *' | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Sync branch to template | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
branch_name=$(git rev-parse --abbrev-ref HEAD) | ||
original_remote=$(git remote get-url origin) | ||
pr_branch="sync/${branch_name}" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git remote add template https://github.com/ubiquity/ts-template | ||
git fetch template development | ||
git update-index --assume-unchanged ".github/workflows/sync.yml" | ||
git merge template/development --allow-unrelated-histories || true | ||
git checkout -b "$pr_branch" | ||
git add . | ||
git push "$original_remote" "$pr_branch" | ||
gh pr create --title "Sync branch to template" --body "This pull request merges changes from the template repository." --head "$pr_branch" --base "$branch_name" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we rename this to
sync-template.yml
for clarity?