This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
Cron bump #781
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: 'Cron bump' | |
on: | |
repository_dispatch: | |
types: do-cron | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
name: 'scrap and push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@master | |
with: | |
ref: master | |
- name: scrap | |
run: | | |
pip3 install -r requirements-dev.txt | |
cp osadl_matrix/osadl-matrix.json osadl-matrix.json.bak | |
python3 scripts/scrapper.py | |
shell: bash | |
- name: check for changes | |
id: new-commits | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "NEW_COMMITS=1" >> $GITHUB_OUTPUT | |
else | |
echo "NEW_COMMITS=0" >> $GITHUB_OUTPUT | |
fi | |
- name: install dependencies | |
if: steps.new-commits.outputs.NEW_COMMITS == '1' | |
run: | | |
python3 -m pip install --upgrade pip build | |
pip3 install -r requirements.txt | |
shell: bash | |
- name: build | |
if: steps.new-commits.outputs.NEW_COMMITS == '1' | |
run: python3 -m build --sdist --wheel | |
shell: bash | |
- name: install more dependencies | |
if: steps.new-commits.outputs.NEW_COMMITS == '1' | |
run: | | |
pip3 install -r requirements-dev.txt | |
shell: bash | |
- name: test | |
if: steps.new-commits.outputs.NEW_COMMITS == '1' | |
run: | | |
pytest | |
shell: bash | |
- name: generate datalog | |
if: steps.new-commits.outputs.NEW_COMMITS == '1' | |
run: | | |
python3 scripts/datalog osadl-matrix.json.bak osadl_matrix/osadl-matrix.json DATALOG.md | |
shell: bash | |
- name: check for release relevant changes | |
id: new-release | |
run: | | |
if [ -n "$(git status --porcelain | grep DATALOG.md )" ]; then | |
echo "NEW_RELEASE=1" >> $GITHUB_OUTPUT | |
else | |
echo "NEW_RELEASE=0" >> $GITHUB_OUTPUT | |
fi | |
- name: push | |
if: steps.new-commits.outputs.NEW_COMMITS == '1' | |
uses: github-actions-x/commit@v2.9 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
push-branch: 'master' | |
commit-message: 'Bump matrix' | |
files: osadl_matrix/osadl-matrix.csv osadl_matrix/osadl-matrix.json DATALOG.md | |
name: ${{ secrets.COMMITER_NAME }} | |
email: ${{ secrets.COMMITER_MAIL }} | |
rebase: 'true' | |
- name: Repository Dispatch | |
if: steps.new-release.outputs.NEW_RELEASE == '1' | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
event-type: cron_release |