Skip to content

feature/improve docs and cli messaging, change package.json script to… #34

feature/improve docs and cli messaging, change package.json script to…

feature/improve docs and cli messaging, change package.json script to… #34

Workflow file for this run

name: Save repository info
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
save_repo_info:
name: Save repository info to .env file
if: >-
${{ !github.event.repository.is_template }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
- name: Override .env files with repository info
run: |
rm -rf apps/sanity/.env
rm -rf apps/storyblok/.env
touch apps/sanity/.env
touch apps/storyblok/.env
echo -e "\nREPO_PROD_BRANCH=\"main\"\nREPO_TYPE=\"github\"\nREPO_ID=${{ github.event.repository.id }}\nREPO_NAME=${{ github.repository }}" >> apps/sanity/.env
echo -e "\nREPO_PROD_BRANCH=\"main\"\nREPO_TYPE=\"github\"\nREPO_ID=${{ github.event.repository.id }}\nREPO_NAME=${{ github.repository }}" >> apps/storyblok/.env
# - name: Remove unnecessary scripts
# run: |
# jq 'del(.scripts["pull-stories"])' apps/storyblok/package.json > apps/storyblok/package.json.tmp
# mv apps/storyblok/package.json.tmp apps/storyblok/package.json
- name: Commit, push, and remove GitHub Actions workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.event.repository.owner.login }}@users.noreply.github.com"
rm -rf .github/workflows
git add .
git commit -m "Add repository info to .env and remove GitHub Actions workflows"
git push origin main