-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-markdown-link-action-fail
- Loading branch information
Showing
7 changed files
with
1,684 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Weekly Ruby Script Runner | ||
|
||
on: | ||
# for testing purposes | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 0 * * 0' # Runs every weekend | ||
|
||
jobs: | ||
run-scripts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4.2.1 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.3.4 | ||
|
||
- name: Install mechanize gem | ||
run: | | ||
gem install mechanize; | ||
- name: Run new.rb script | ||
id: run-new-rb-script | ||
run: | | ||
ruby seek/new.rb; | ||
exit_code=$?; | ||
echo "new.rb exit code: $exit_code"; | ||
echo "exit_code=$exit_code" >> $GITHUB_ENV; | ||
if [ $exit_code -eq 0 ]; then | ||
echo "new.rb succeeded."; | ||
else | ||
echo "new.rb failed with exit code $exit_code."; | ||
exit $exit_code; # Exit with the last exit code | ||
fi; | ||
- name: Commit and push changes if any | ||
if: env.exit_code == '0' | ||
run: | | ||
git config --global user.name "github-actions[bot]"; | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com"; | ||
git add seek/job_ind.json; | ||
if git diff-index --quiet HEAD; then | ||
echo "No changes to commit."; | ||
else | ||
git commit -m "Update seek/job_ind.json"; | ||
git push origin main; | ||
fi; |
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
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
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
Oops, something went wrong.