Skip to content

feat: add cruft config and workflow #1

feat: add cruft config and workflow

feat: add cruft config and workflow #1

name: Update Cruft Commit ID
on: [push]
jobs:
update-cruft:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Update .cruft.json with latest commit ID
run: |
# Replace 'path/to/.cruft.json' with the actual path to your .cruft.json file
LATEST_COMMIT_ID=$(git rev-parse HEAD)
echo "Latest commit ID: $LATEST_COMMIT_ID"
# Assuming .cruft.json is at the root and using jq to update it
jq --arg commit "$LATEST_COMMIT_ID" '.commit = $commit' .cruft.json > temp.json && mv temp.json .cruft.json
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions Bot"
git add .cruft.json
git commit -m "Automatically update .cruft.json with latest commit ID" || echo "No changes to commit"
git push