discordo/.github/workflows/ci.yml
Ayyan ef0075b410
Potential fix for code scanning alert no. 1: Workflow does not contain permissions (#534)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-05 19:52:16 -04:00

37 lines
1.2 KiB
YAML

name: ci
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Build
run: go build -ldflags "-s -w" .
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
with:
name: discordo_${{ runner.os }}_${{ runner.arch }}
path: |
discordo
discordo.exe
- name: Send repository dispatch
if: ${{ runner.os == 'Windows' && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
env:
GH_TOKEN: ${{ secrets.PAT }}
run: |
gh api --method POST -H "Accept: application/vnd.github+json" -f "event_type=discordo-ci-completed" /repos/vvirtues/bucket/dispatches