Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
* @electron/wg-ecosystem
/blog/ @electron/wg-outreach

# There is no code owner for the docs directory
# so that bots can approve automated PRs to it
/docs/
26 changes: 24 additions & 2 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
update-docs:
runs-on: ubuntu-latest
environment: docs-updater
env:
SHA: ${{ github.event.client_payload.sha || github.event.inputs.sha }}
permissions:
pull-requests: write
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
Expand All @@ -35,14 +39,32 @@ jobs:
run: yarn install --frozen-lockfile
- name: Prebuild
run: |
yarn pre-build ${{ github.event.client_payload.sha || github.event.inputs.sha }}
yarn pre-build ${SHA}
git add .
if [ "$(git status --porcelain | grep -v 'docs/latest/.sha')" = "" ]; then
echo "Unexpectedly found no new content for docs - this is probably a bug"
exit 1
fi
- name: Push changes
- name: Push changes to branch
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
with:
message: 'chore: update ref to docs (🤖)'
ref: 'docs/update-to-${{ env.SHA }}'
token: ${{ steps.generate-token.outputs.token }}
- name: Create pull request
shell: bash
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
gh pr create \
--title "chore: update ref to docs (🤖)" \
--body "Automated PR to update the docs to the latest commit (${SHA})" \
--head "docs/update-to-${SHA}" \
--base main
- name: Approve and merge pull request
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr review "docs/update-to-${SHA}" --approve
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naive question: would this be a self-approve and then not count for the purposes of mergeability?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a subtle difference here (which I could call out better in the code with a comment), but we're using secrets.GITHUB_TOKEN here so it'll be the default GitHub Actions app approving the PR, which was opened by our GitHub app.

gh pr merge "docs/update-to-${SHA}" --auto --squash