added the workflow files to automattically update the patch count
This commit is contained in:
parent
bee788f6ab
commit
7b2cc61d99
|
@ -0,0 +1,34 @@
|
||||||
|
name: Count Patches
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
env:
|
||||||
|
TAG_COMMIT: 49a8273..
|
||||||
|
jobs:
|
||||||
|
patch-count:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Get latest commit
|
||||||
|
id: log
|
||||||
|
run: echo "::set-output name=message::$(git log --no-merges -1 --oneline)"
|
||||||
|
- name: Get repo name
|
||||||
|
id: repo
|
||||||
|
run: echo "::set-output name=message::$GITHUB_REPOSITORY"
|
||||||
|
- name: Insert Patch Count
|
||||||
|
if: "!contains(steps.log.outputs.message, 'Updated Patch Count') && contains(steps.repo.outputs.message, 'lnis-uofu/OpenFPGA')"
|
||||||
|
run: |
|
||||||
|
sed -i "/^set(OPENFPGA_VERSION_PATCH /s/[0-9]*)/`git log ${TAG_COMMIT} --oneline | wc -l`)/" CMakeLists.txt
|
||||||
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git add Makefile
|
||||||
|
git commit -m "Updated Patch Count"
|
||||||
|
- name: Push changes # push the output folder to your repo
|
||||||
|
if: "!contains(steps.log.outputs.message, 'Bump version') && contains(steps.repo.outputs.message, 'lnis-uofu/OpenFPGA')"
|
||||||
|
uses: ad-m/github-push-action@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue