Skip to content

Fix issue workflow (#1756) #3731

Fix issue workflow (#1756)

Fix issue workflow (#1756) #3731

Workflow file for this run

name: lint
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ok-nick/[email protected]
with:
token: ${{ SECRETS.GITHUB_TOKEN }}
- name: Cache Roblox Standard Library
id: cache-roblox-std
uses: actions/[email protected]
with:
path: roblox.yml
key: roblox-std
- name: Check standard roblox library status
id: check-roblox-std
env:
DID_CACHE: ${{steps.cache-roblox-std.outputs.cache-hit}}
run: |
if test -f roblox.yml; then
CUR_ROBLOX_STD_TIMEDATE="$(date +%s -d "$(cat roblox.yml | head -n 1 | grep -oP "\d{4}-\d{2}-\d{2}(?=\s+\d{2}:\d{2}:\d{2})")")"
else
CUR_ROBLOX_STD_TIMEDATE=0
fi
if [ "$DID_CACHE" == "true" ]
then
if [ "$(($(date +%s)-$CUR_ROBLOX_STD_TIMEDATE))" -ge "604800" ]
then
echo "::notice ::Roblox Standard Library Cache is out of date by 1 week, requiring a refresh of the standard library cache."
echo "should-fetch=true" >> $GITHUB_OUTPUT
else
echo "should-fetch=false" >> $GITHUB_OUTPUT
fi
else
echo "should-fetch=true" >> $GITHUB_OUTPUT
fi
- name: Update standard roblox library
if: steps.check-roblox-std.outputs.should-fetch == 'true'
run: |
selene generate-roblox-std
- name: Lint
run: |
selene ./MainModule ./Loader