Skip to content

Conversation

Copy link

Copilot AI commented Dec 13, 2025

Adds CI automation to run tests on push and pull request events.

Changes

  • .github/workflows/test.yml: GitHub Actions workflow that checks out code, sets up Go 1.25.5, and runs make test
  • Triggers on push to main/master branches only (prevents duplicate test runs for same-repo PRs)
  • Triggers on all pull request events
  • Includes explicit permissions: contents: read to limit token scope
on:
  push:
    branches:
      - main
      - master
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-go@v5
      with:
        go-version: '1.25.5'
    - run: make test

The workflow avoids running tests twice when PRs are created from branches in the same repository by limiting push triggers to main/master branches while running on all pull request events.

Original prompt

This section details on the original issue you should resolve

<issue_title>github action for tests</issue_title>
<issue_description>Create a github action that runs the tests on push and pull requests. </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 13, 2025 21:58
Co-authored-by: splitbrain <86426+splitbrain@users.noreply.github.com>
Co-authored-by: splitbrain <86426+splitbrain@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub action to run tests on push and pull requests Add GitHub Actions workflow for automated testing Dec 13, 2025
Copilot AI requested a review from splitbrain December 13, 2025 22:01
Copy link
Owner

@splitbrain splitbrain left a comment

Choose a reason for hiding this comment

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

do not run the tests twice when a pr is created from a branch in this repo - you can skip running the push workflow then

push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
Copy link
Owner

Choose a reason for hiding this comment

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

leave out the branches if they aren't limited anyway

Copy link
Author

Choose a reason for hiding this comment

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

Removed in 00562dd. The pull_request trigger no longer has a branches specification.

Co-authored-by: splitbrain <86426+splitbrain@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 13, 2025

do not run the tests twice when a pr is created from a branch in this repo - you can skip running the push workflow then

Fixed in 00562dd. Push events now only trigger on main/master branches, while pull_request events run for all branches. This prevents duplicate test runs when PRs are created from branches in the same repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

github action for tests

2 participants