Skip to content

Skip Contributors workflow when repository owner pushes to main#8

Merged
pusewicz merged 2 commits intomainfrom
copilot/update-contributors-workflow-condition
Jan 29, 2026
Merged

Skip Contributors workflow when repository owner pushes to main#8
pusewicz merged 2 commits intomainfrom
copilot/update-contributors-workflow-condition

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

The Contributors workflow runs on every push to main, creating unnecessary runs when the repository owner commits.

Changes

Added conditional execution to contrib-readme-job:

jobs:
  contrib-readme-job:
    runs-on: ubuntu-latest
    name: Automate contributors list in README
    if: github.event.pusher.name != github.repository_owner
    permissions:
      contents: write
      pull-requests: write

The job now skips when github.event.pusher.name matches github.repository_owner, executing only for non-owner contributors.

Original prompt

Problem

The Contributors workflow currently runs on every push to the main branch, even when the repository owner makes the commit. This can create unnecessary workflow runs.

Solution

Add a condition to skip the contrib-readme-job when the pusher is the repository owner.

Changes Required

Update .github/workflows/contributors.yml:

  • Add an if condition to the contrib-readme-job that checks if the pusher is not the repository owner
  • The condition should be: if: github.event.pusher.name != github.repository_owner
  • This should be added after the job name and before the permissions block

Current File

The file to modify is located at .github/workflows/contributors.yml (commit: 3e0aeae)

Expected Result

The workflow will skip execution when the repository owner pushes commits, but will still run for other contributors.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…hes commits

Co-authored-by: pusewicz <940+pusewicz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add skip condition for contrib-readme-job Skip Contributors workflow when repository owner pushes to main Jan 29, 2026
Copilot AI requested a review from pusewicz January 29, 2026 12:18
@pusewicz pusewicz marked this pull request as ready for review January 29, 2026 12:18
@pusewicz pusewicz merged commit 9acaf7f into main Jan 29, 2026
1 check failed
@pusewicz pusewicz deleted the copilot/update-contributors-workflow-condition branch January 29, 2026 12:18
@pusewicz
Copy link
Owner

@copilot Is this going to run if someone else opens the PR, but I merge it myself being the owner? We need this to happen.

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.

2 participants