Skip to content

Commit

Permalink
build: update docs on Electron releases
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 authored Jan 17, 2025
1 parent 274f216 commit 7dd5e0e
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
name: 'Update docs'

on:
repository_dispatch:
types: [doc_changes]
workflow_dispatch:
inputs:
sha:
version:
type: string
description: The SHA of the `electron/electron` commit
description: The version of the latest Electron release
required: true

concurrency: update-docs

permissions: {}

jobs:
get-latest-stable:
runs-on: ubuntu-latest
outputs:
major: ${{ steps.latest-stable-major.outputs.major }}
steps:
- run: npm install @electron/fiddle-core
- name: Get Latest Stable Major
id: latest-stable-major
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { ElectronVersions } = await import('${{ github.workspace }}/node_modules/@electron/fiddle-core/dist/index.js');
const { latestStable } = await ElectronVersions.create(undefined, { ignoreCache: true });
core.setOutput('major', latestStable.major);
update-docs:
runs-on: ubuntu-latest
environment: docs-updater
needs: get-latest-stable
if: ${{ startsWith(github.event.inputs.version, format('v{0}', needs.get-latest-stable.outputs.major)) }}
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
Expand All @@ -34,10 +49,10 @@ jobs:
uses: bahmutov/npm-install@ec9e87262db2a1be2ca3ceb2d506c413a220542c # tag: v1.10.5
- name: Prebuild
run: |
yarn pre-build ${{ github.event.client_payload.sha || github.event.inputs.sha }}
yarn pre-build ${{ github.event.inputs.version }}
git add .
- name: Push changes
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
with:
message: 'chore: update ref to docs (🤖)'
token: ${{ steps.generate-token.outputs.token }}
# - name: Push changes
# uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
# with:
# message: 'chore: update ref to docs (🤖)'
# token: ${{ steps.generate-token.outputs.token }}

0 comments on commit 7dd5e0e

Please sign in to comment.