Skip to content

Commit

Permalink
run grept each week, submit changes as pull request.
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Dec 18, 2023
1 parent 6a879b8 commit db5e51f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/weekly-cronjob.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Weekly Cronjob
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

permissions:
contents: write
pull-requests: write

jobs:
grept-check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- id: grept-apply
name: grept-apply
run: |
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make grept-apply
git config user.name "github-actions[bot]"
git config user.email "grept-bot[bot]@users.noreply.github.com"
git add -A
git commit -am "Update generated by \`grept\`"
git diff-tree --no-commit-id --name-only -r HEAD
echo "CHANGED_FILES_COUNT=$(git diff-tree --no-commit-id --name-only -r HEAD | wc -l)" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.grept-apply.outputs.CHANGED_FILES_COUNT!='0'
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 #v5.0.2
with:
title: 'Update generated by `grept`'
body: 'Update generated by `grept`. Due to the limitation of [github action](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs), please close this PR manually and then reopen it to trigger a `pull_request` event.'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ terraform.rc
avmmakefile
README-generated.md
avm.tflint.hcl
avm.tflint_example.hcl
avm.tflint_example.hcl

0 comments on commit db5e51f

Please sign in to comment.