Skip to content

Commit

Permalink
ci: Add GitHub app
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Feb 14, 2024
1 parent c8afc83 commit f4fc345
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"ignorePresets": [
"github>gabe565/renovate-config:githubActions"
],
"gitIgnoredAuthors": ["renovate[bot]@users.noreply.github.com"],
"gitIgnoredAuthors": [
"renovate[bot]@users.noreply.github.com",
"160046936+charts-bot[bot]@users.noreply.github.com"
],
"regexManagers": [
{
"fileMatch": ["\\.yaml$"],
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,26 @@ jobs:
release-charts:
name: Release Charts
runs-on: ubuntu-latest
env:
AUTHOR_USER: chart-bot
AUTHOR_EMAIL: 160046936+charts-bot[bot]@users.noreply.github.com
steps:
- name: Generate Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$[email protected]"
git config user.name "${{ env.AUTHOR_USER }}"
git config user.email "${{ env.AUTHOR_EMAIL }}"
- name: Add Helm repos
run: |
Expand Down Expand Up @@ -87,7 +97,7 @@ jobs:
with:
skip_packaging: true
env:
CR_TOKEN: ${{ github.token }}
CR_TOKEN: ${{ steps.app-token.outputs.token }}
CR_PAGES_BRANCH: helm-index

build-docs:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,21 @@ jobs:
update-chart-metadata:
name: Update Chart Metadata
runs-on: ubuntu-latest
env:
AUTHOR_USER: chart-bot
AUTHOR_EMAIL: 160046936+charts-bot[bot]@users.noreply.github.com
steps:
- name: Generate Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0

- name: Detect Changes
Expand All @@ -31,6 +42,7 @@ jobs:
id: pr
uses: actions/github-script@v7
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
const response = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
Expand Down Expand Up @@ -93,4 +105,7 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.commit_exists.outputs.result == 'false' && !contains(steps.pr.outputs.labels, 'skip-chart-meta')
with:
commit_user_name: ${{ env.AUTHOR_USER }}
commit_user_email: ${{ env.AUTHOR_EMAIL }}
commit_author: ${{ env.AUTHOR_USER }} <${{ env.AUTHOR_EMAIL }}>
commit_message: ${{ env.COMMIT_MESSAGE }}

0 comments on commit f4fc345

Please sign in to comment.