Skip to content

Fetch Sidekiq Reliable Fetch Gem #143

Fetch Sidekiq Reliable Fetch Gem

Fetch Sidekiq Reliable Fetch Gem #143

Workflow file for this run

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
- name: Setup directories
run: |
mkdir -p ./vendor/gems/sidekiq-reliable-fetch
echo "Local directory for sidekiq-reliable-fetch is ready."
- name: Setup temporary directory
run: |
TEMP_DIR=$(mktemp -d)
echo "TEMP_DIR=${TEMP_DIR}" >> $GITHUB_ENV
- name: Fetch vendor directory from GitLab
run: |
git clone --depth 1 --filter=blob:none --sparse https://gitlab.com/gitlab-org/gitlab.git $TEMP_DIR/gitlab
cd $TEMP_DIR/gitlab
git sparse-checkout set vendor/gems/sidekiq-reliable-fetch
git checkout master
ls -l
- name: Copy sidekiq-reliable-fetch to local repository
run: |
cd ${{ github.workspace }}
cp -R $TEMP_DIR/gitlab/vendor/gems/sidekiq-reliable-fetch/* ${{ github.workspace }}
ls -l
- name: Commit and push changes
run: |
git config --global user.name 'Mostafa Dahab'
git config --global user.email 'poweroftrue@users.noreply.github.com'
git add .
git diff --staged --quiet || git commit -m "Update sidekiq-reliable-fetch gem"
git push origin HEAD:main --force