-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mostafa Dahab <[email protected]>
- Loading branch information
1 parent
07decbe
commit 80bc287
Showing
1 changed file
with
13 additions
and
15 deletions.
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 |
---|---|---|
|
@@ -6,33 +6,31 @@ on: | |
workflow_dispatch: # Allows manual trigger | ||
|
||
jobs: | ||
update-gem: | ||
sync-gem: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout current repo | ||
- name: Checkout current GitHub repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: 'main' # Ensure we're on the correct branch | ||
ref: 'main' | ||
|
||
- name: Setup Git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Your Name" | ||
git config --global user.name "GitHub Actions" | ||
- name: Sparse checkout and update gem | ||
- name: Sparse checkout from GitLab | ||
run: | | ||
git remote add upstream https://gitlab.com/gitlab-org/gitlab.git || true | ||
git remote add gitlab https://gitlab.com/gitlab-org/gitlab.git || true | ||
git config core.sparseCheckout true | ||
echo "vendor/gems/sidekiq-reliable-fetch" > .git/info/sparse-checkout | ||
git fetch --depth=1 upstream master # Fetch from GitLab master | ||
git reset --hard FETCH_HEAD | ||
git clean -df | ||
git fetch gitlab master --depth=1 | ||
git checkout FETCH_HEAD | ||
git reset --soft HEAD@{1} | ||
- name: Commit changes | ||
- name: Commit and push changes to GitHub | ||
run: | | ||
git add -A | ||
git diff-index --quiet HEAD || git commit -m "Update sidekiq-reliable-fetch gem" | ||
- name: Force push changes to main | ||
run: git push origin main --force | ||
git restore --staged .github # Ensure .github directory is not included in the commit | ||
git commit -m "Update sidekiq-reliable-fetch gem from GitLab" | ||
git push origin main --force-with-lease |