Workflow file for this run
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: Update .env with GitHub Token | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
update-env: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Update .env file | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "GITHUB_TOKEN=$GITHUB_TOKEN" >> .env | |
echo "GitHub Token added to .env file successfully" | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add .env | |
git commit -m "Update .env with new GitHub Token" || echo "No changes to commit" | |
git push |