Skip to content

Instantly share code, notes, and snippets.

@ashtom
Last active January 2, 2025 03:31
Show Gist options
  • Save ashtom/0ca3193ce0ac76f9c6bf0b3aa9cad124 to your computer and use it in GitHub Desktop.
Save ashtom/0ca3193ce0ac76f9c6bf0b3aa9cad124 to your computer and use it in GitHub Desktop.
GitHub Actions workflow for health repo
name: Build and Test
on:
push:
branches: [ master ]
paths:
- 'workouts/**.csv'
- '.github/**'
jobs:
build:
name: Gist Box
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.1
- name: Cache gems
uses: actions/[email protected]
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: Install gems
run: |
gem install octokit
- name: Run script to update gist
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIST_ID: ${{ secrets.GIST_ID }}
run: |
ruby .github/scripts/hadge.rb -t $GH_TOKEN -g $GIST_ID workouts/2025.csv
@aaishikasb
Copy link

Hey @ashtom, absolutely love Hadge! I have a couple of fixes that I'd recommend to ensure relevancy, in light of deprecated actions:

  1. Line 18: Replace actions/setup-ruby@v1 with ruby/setup-ruby@v1. (Also, the Ruby version that worked effortlessly for me is ruby-version: 3.0.0)
  2. Line 22: Replace actions/[email protected] with actions/[email protected]

@ashtom
Copy link
Author

ashtom commented Jan 2, 2025

@aaishikasb Thanks, just updated to the version I am using for 2025 and it includes both your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment