Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tahadostifam committed Apr 1, 2024
2 parents 59dd7d7 + c26ffdd commit a929ed1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/update_contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
branches:
- main
schedule:
- cron: "0 0 */3 * *" # Runs at midnight (0:00) every 3rd day

jobs:
run_ruby_script:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.0'
- name: Install Bundler
run: |
gem list bundle
- name: Bundle install dependencies
run: bundle install
- name: Set environment variable (securely)
run: |
echo "::group::"
echo "Setting GITHUB_PERSONAL_ACCESS_TOKEN..."
echo "GITHUB_PERSONAL_ACCESS_TOKEN=${{ secrets.GITHUBPA }}" >> $GITHUB_ENV # Store token securely
echo "::endgroup::"
- name: Update contributors list
run: |
chmod +x main.rb
ruby main.rb
- name: Commit changes
run: |
git config --local user.name "tahadostifam"
git config --local user.email "mr.tahadostifam@gmail.com"
git add ./json/contributors.json
git commit -m "Contributors list located at json/contributors.json updated by github-worfklow"
- name: Push changes # push the output folder to your repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUBPA }}
force: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
json/contributors.json
.idea
.vscode
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
gem "octokit", "~> 8.1"
source 'http://rubygems.org'

gem "octokit", "~> 8.1"
Loading

0 comments on commit a929ed1

Please sign in to comment.