Bump checkout v #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Save Repository Info to .env.initial | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
get_current_step: | |
name: Check current step number | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- id: get_step | |
run: | | |
if [ -f ./.github/script/STEP ]; then | |
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT | |
else | |
echo "current_step=0" >> $GITHUB_OUTPUT | |
fi | |
outputs: | |
current_step: ${{ steps.get_step.outputs.current_step }} | |
save_repo_info: | |
name: Save Repository Info | |
needs: get_current_step | |
if: >- | |
${{ !github.event.repository.is_template | |
&& needs.get_current_step.outputs.current_step == 0 }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Print and Save Repository Info | |
run: | | |
echo "Repository ID: ${{ github.event.repository.id }}" | |
echo "REPO_ID=${{ github.event.repository.id }}" > .env.initial | |
echo "Repository Name: ${{ github.repository }}" | |
echo "REPO_NAME=${{ github.repository }}" >> .env.initial | |
echo "MAX_NUMBER_OF_PROJECTS=7" >> .env.initial | |
echo "REPO_PROD_BRANCH=main" >> .env.initial | |
- name: Commit and Push .env.initial | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email '[email protected]' | |
git add .env.initial | |
git commit -m "Add repository info to .env.initial" | |
git push origin main |