Skip to content

Commit

Permalink
ci(pre-commit): add autoupdate workflow (autowarefoundation#3050)
Browse files Browse the repository at this point in the history
Signed-off-by: Kenji Miyake <[email protected]>

Signed-off-by: Kenji Miyake <[email protected]>
  • Loading branch information
kenji-miyake authored Nov 18, 2022
1 parent bec22cb commit 6eddd9c
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/pre-commit-ansible-autoupdate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: pre-commit-ansible-autoupdate

on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
check-secret:
uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1
secrets:
secret: ${{ secrets.APP_ID }}

pre-commit-ansible-autoupdate:
needs: check-secret
if: ${{ needs.check-secret.outputs.set == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Run pre-commit-autoupdate
uses: autowarefoundation/autoware-github-actions/pre-commit-autoupdate@v1
with:
token: ${{ steps.generate-token.outputs.token }}
pre-commit-config: .pre-commit-config-ansible.yaml
pr-labels: |
bot
pre-commit-ansible-autoupdate
pr-branch: pre-commit-ansible-autoupdate
pr-title: "ci(pre-commit-ansible): autoupdate"
pr-commit-message: "ci(pre-commit-ansible): autoupdate"
auto-merge-method: squash
38 changes: 38 additions & 0 deletions .github/workflows/pre-commit-autoupdate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: pre-commit-autoupdate

on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
check-secret:
if: ${{ github.event.repository.private }}
uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1
secrets:
secret: ${{ secrets.APP_ID }}

pre-commit-autoupdate:
needs: check-secret
if: ${{ needs.check-secret.outputs.set == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Run pre-commit-autoupdate
uses: autowarefoundation/autoware-github-actions/pre-commit-autoupdate@v1
with:
token: ${{ steps.generate-token.outputs.token }}
pre-commit-config: .pre-commit-config.yaml
pr-labels: |
bot
pre-commit-autoupdate
pr-branch: pre-commit-autoupdate
pr-title: "ci(pre-commit): autoupdate"
pr-commit-message: "ci(pre-commit): autoupdate"
auto-merge-method: squash
37 changes: 37 additions & 0 deletions .github/workflows/pre-commit-optional-autoupdate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: pre-commit-optional-autoupdate

on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
check-secret:
uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1
secrets:
secret: ${{ secrets.APP_ID }}

pre-commit-optional-autoupdate:
needs: check-secret
if: ${{ needs.check-secret.outputs.set == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Run pre-commit-autoupdate
uses: autowarefoundation/autoware-github-actions/pre-commit-autoupdate@v1
with:
token: ${{ steps.generate-token.outputs.token }}
pre-commit-config: .pre-commit-config-optional.yaml
pr-labels: |
bot
pre-commit-optional-autoupdate
pr-branch: pre-commit-optional-autoupdate
pr-title: "ci(pre-commit-optional): autoupdate"
pr-commit-message: "ci(pre-commit-optional): autoupdate"
auto-merge-method: squash

0 comments on commit 6eddd9c

Please sign in to comment.