mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
comparing the checksum of the CodeExamples.md file to see if it has been changed before commiting
This commit is contained in:
parent
3c05cc447e
commit
3a4da10c08
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@ -200,23 +200,13 @@ jobs:
|
|||||||
path: 'ocean.js'
|
path: 'ocean.js'
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: Create code examples file
|
|
||||||
uses: actions/cache@v2
|
|
||||||
env:
|
|
||||||
cache-name: cache-node-modules
|
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-lint-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: ${{ runner.os }}-lint-${{ env.cache-name }}-
|
|
||||||
- run: npm run create:guide
|
|
||||||
|
|
||||||
- name: setup git config
|
- name: setup git config
|
||||||
run: |
|
run: |
|
||||||
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
|
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
|
||||||
git config user.name "GitHub Actions Bot"
|
git config user.name "GitHub Actions Bot"
|
||||||
git config user.email "<>"
|
git config user.email "<>"
|
||||||
|
|
||||||
- name: Commit if there are changes
|
- name: Create Guide & Commit if there are changes
|
||||||
run: npm run commit:guide
|
run: npm run commit:guide
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
# Check if the CodeExamples.md file has been changed
|
# Check if the CodeExamples.md file has been changed
|
||||||
FILE=CodeExamples.md
|
original=$(md5sum CodeExamples.md)
|
||||||
# Timeframe for the comparison
|
echo $original
|
||||||
OLDTIME=60
|
npm run create:guide
|
||||||
# Get current and file times
|
new=$(md5sum CodeExamples.md)
|
||||||
CURTIME=$(date +%s)
|
echo $new
|
||||||
FILETIME=$(stat $FILE -c %Y)
|
|
||||||
TIMEDIFF=$(expr $CURTIME - $FILETIME)
|
|
||||||
|
|
||||||
# Check if file older
|
# Check if file has changed
|
||||||
if [ $TIMEDIFF -gt $OLDTIME ]; then
|
if [ "$new" = "$original" ]; then
|
||||||
echo "CodeExamples.md file has not been changed"
|
echo "CodeExamples.md file has not been changed"
|
||||||
else
|
else
|
||||||
echo "CodeExamples.md file has been changed. Committing changes"
|
echo "CodeExamples.md file has been changed. Committing changes"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user