Daily Contributions #13
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: Daily Contributions | |
#on: | |
on: | |
issue_comment: | |
types: [created, deleted] | |
#schedule: | |
#- cron: '*/10 * * * *' | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: ["archive"] | |
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 "<>" | |
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 |