Trigger Daily Contribution #5
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: Create Contribution | |
#on: | |
on: | |
issue_comment: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
- name: git | |
run: | | |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default | |
git --version | |
git config user.name "chirbard" | |
git config user.email "[email protected]" | |
git switch archive | |
git switch main | |
formatted_date=$(date -I) | |
echo $formatted_date | |
git restore --source archive -- "${formatted_date}/" | |
git add --all | |
git commit -m "daily commit ${formatted_date}" | |
git push |