Search code examples
github-actionselectron-builder

Error when building my Electron app in GitHub Actions


This is the image about the error. It seems that I cannot connect to the GitHub?

enter image description here

This is my .yml file.

name: Build/release

on:
  push:
    tags:
      - v*

jobs:
  release:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]

    steps:
      - name: Check out Git repository
        uses: actions/checkout@v3

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v3
        with:
          node-version: 16

      - name: Build/release Electron app
        uses: ResearchHelper/action-electron-builder@master
        with:
          # GitHub token, automatically provided to the action
          # (No need to define this secret in the repo settings)
          github_token: ${{ secrets.github_token }}
          # skip build script in package.json
          # jump to the electron-builder build directly
          skip_build: true
          # release after build
          release: true

And I haven't add anything in "Actions secrets and variables".

I just try the GitHub Actions for the first time.

I have no idea about how to fix it. :(

Just fix this problem.


Solution

  • Your workflow, by default, doesn't get permissions to change content. You can request additional permissions for your GitHub Token through the permissions keyword:

    permissions:
       contents: write
    

    See: