Skip to content

Commit

Permalink
Add automation for npm update (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeSCahill authored Aug 23, 2024
1 parent b38734c commit 6a3ff4f
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/update-extensions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Update @redpanda-data/docs-extensions-and-macros

on:
workflow_dispatch:
repository_dispatch:
types: [trigger-npm-update]

jobs:
update-dependency:
runs-on: ubuntu-latest

strategy:
matrix:
branch: [main]

steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_SM_READONLY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SM_READONLY_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: get secrets from aws sm
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
,sdlc/prod/github/actions_bot_token
parse-json-secrets: true
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
token: ${{ env.ACTIONS_BOT_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Update @redpanda-data/docs-extensions-and-macros
run: npm update @redpanda-data/docs-extensions-and-macros

- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git commit -m "Update @redpanda-data/docs-extensions-and-macros"
env:
ACCESS_TOKEN: ${{ env.ACTIONS_BOT_TOKEN }}

- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "auto-docs: update @redpanda-data/docs-extensions-and-macros"
token: ${{ env.ACTIONS_BOT_TOKEN }}
branch: update-branch-${{ matrix.branch }}
title: "auto-docs: Update extensions on ${{ matrix.branch }}"
body: "This PR updates the @redpanda-data/docs-extensions-and-macros package on the ${{ matrix.branch }} branch."
labels: auto-docs
reviewers: asimms41, JakeSCahill, Deflaimun

0 comments on commit 6a3ff4f

Please sign in to comment.