Skip to content

doc_changes_branches #420

doc_changes_branches

doc_changes_branches #420

name: 'Update docs branch'
on:
repository_dispatch:
types: [doc_changes_branches]
workflow_dispatch:
inputs:
branch:
type: string
description: The branch of the commit, usually something like `15-x-y`
required: true
sha:
type: string
description: The SHA of the `electron/electron` commit
required: true
permissions: {}
jobs:
update-docs:
runs-on: ubuntu-latest
environment: docs-updater
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
id: generate-token
with:
creds: ${{ secrets.DOCS_UPDATER_GH_APP_CREDS }}
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # tag: v4.1.4
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Switch branches
# We switch to the version branch or create a new one if needed
run: git fetch origin && git checkout -t origin/v${{ github.event.client_payload.branch || github.event.inputs.branch }} || git checkout -b v${{ github.event.client_payload.branch || github.event.inputs.branch }}
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # tag: v4.0.2
with:
node-version: 20
- name: Install dependencies
uses: bahmutov/npm-install@237ded403e6012a48281f4572eab0c8eafe55b3f # tag: v1.10.1
- name: Prebuild
run: |
yarn pre-build ${{ github.event.client_payload.sha || github.event.inputs.sha }}
git add .
- name: Push changes
uses: dsanders11/github-app-commit-action@48d2ff8c1a855eb15d16afa97ae12616456d7cbc # v1.4.0
with:
message: 'chore: update ref to docs (🤖)'
token: ${{ steps.generate-token.outputs.token }}