Skip to content

Commit

Permalink
ci(lifecycle): add possibility to use github app for PR (#107)
Browse files Browse the repository at this point in the history
Signed-off-by: Charly Molter <charly.molter@konghq.com>
  • Loading branch information
lahabana authored Jan 12, 2024
1 parent 0b4e6b4 commit d3d0d16
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/wfc_lifecycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ on:
description: "list of files to ignore from syncing from the community repo"
required: false
default: ""

secrets:
app_id:
required: false
private_key:
required: false
jobs:
open:
if: (github.event.action == 'reopened' || github.event.action == 'opened')
Expand Down Expand Up @@ -183,12 +187,18 @@ jobs:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
syncFilesFromGithub:
if: (github.event.workflow || github.event.schedule) && github.repository != 'kumahq/.github'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: github-app-token
if: ${{ secrets.app_id }}
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
with:
app_id: ${{ secrets.app_id }}
private_key: ${{ secrets.private_key }}
- name: Sync files from kumahq/.github
env:
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token || secrets.GITHUB_TOKEN }}
run: |
for f in `echo '${{ inputs.filesToSync }}' | tr "," " "`; do
if echo ',${{ inputs.filesToIgnore }},' | grep -q ",${f},"; then
Expand All @@ -206,6 +216,7 @@ jobs:
committer: GitHub <noreply@github.com>
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
signoff: true
token: ${{ steps.github-app-token.outputs.token || secrets.GITHUB_TOKEN }}
branch: chore/upgrade-githubfiles
delete-branch: true
title: "ci(.github): automatic sync of files in kumahq/.github"
Expand Down

0 comments on commit d3d0d16

Please sign in to comment.