Fetch Sidekiq Reliable Fetch Gem #10
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
name: Fetch Sidekiq Reliable Fetch Gem | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs every day at midnight | |
workflow_dispatch: # Allows manual trigger | |
permissions: | |
contents: write | |
jobs: | |
sync-gem: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags to enable proper comparison and push | |
- name: Setup Git | |
run: | | |
git config --global user.name 'Mostafa Dahab' | |
git config --global user.email '[email protected]' | |
- name: Sparse checkout from GitLab and prepare changes | |
run: | | |
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 gitlab master --depth=1 | |
git checkout FETCH_HEAD | |
git reset --soft HEAD@{1} | |
- name: Exclude .github directory and commit changes | |
run: | | |
git restore --staged .github || echo ".github directory not changed" | |
git commit -m "Update sidekiq-reliable-fetch gem from GitLab" | |
git push origin main --force-with-lease |