add dt stamp to commit message #4
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: Fetch Licenses | |
on: | |
workflow_dispatch: # Allows manual triggering of the workflow | |
schedule: | |
- cron: '0 0 * * *' # Runs at midnight ET | |
push: | |
branches: | |
- elr/update-licenses | |
jobs: | |
fetch-licenses: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Checkout SPDX Repository | |
uses: actions/checkout@v2 | |
with: | |
repository: spdx/license-list-data | |
path: spdx-license-list-data | |
- name: Copy Licenses | |
run: | | |
cp spdx-license-list-data/json/licenses.json cmd/licenses.json | |
cp spdx-license-list-data/json/exceptions.json cmd/exceptions.json | |
- name: Check for changes | |
run: | | |
git diff --exit-code -- cmd/licenses.json cmd/exceptions.json || exit 0 | |
- name: Commit and push | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add cmd/licenses.json cmd/exceptions.json | |
git commit -m "Add updated license files - $(date)" -a | |
git push | |