Skip to content
Discussion options

You must be logged in to vote

To prevent a GitHub Actions workflow from triggering itself in an infinite loop, you can use conditional checks within your workflow to determine if the commit was made by a GitHub Actions bot or by another user. If the commit was made by the bot, you can skip the rest of the job.

Here is a common approach using the GITHUB_ACTOR and github.event contexts:

jobs:
  build:
    runs-on: ubuntu-latest
    if: ${{ github.actor != 'github-actions[bot]' && github.event_name != 'push' || github.event.pusher.name != 'github-actions[bot]' }}
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      # Your other steps...

In this example:

github.actor provides the name of the pe…

Replies: 27 comments 45 replies

Comment options

You must be logged in to vote
18 replies
@Afshin9x9-pixel

This comment was marked as off-topic.

@LadyE215
Comment options

@muzamiljammuzamil114-star
Comment options

@098kmayuran-create

This comment was marked as off-topic.

@4C7CCY
Comment options

Answer selected by iamshreeram
Comment options

You must be logged in to vote
2 replies
@smitovich

This comment was marked as off-topic.

@Semsemq
Comment options

Comment options

You must be logged in to vote
4 replies
@assignUser
Comment options

@1463389
Comment options

@zxczxc091664192

This comment was marked as off-topic.

@Afshin9x9-pixel

This comment was marked as off-topic.

Comment options

You must be logged in to vote
0 replies

This comment was marked as off-topic.

@Jihad85-D

This comment was marked as off-topic.

Comment options

You must be logged in to vote
1 reply
@mdlassu
Comment options

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@MindFireGPSDevEleSearch

This comment was marked as off-topic.

@MindFireGPSDevEleSearch

This comment was marked as off-topic.

@MindFireGPSDevEleSearch

This comment was marked as off-topic.

This comment was marked as off-topic.

@mdlassu
Comment options

@Afshin9x9-pixel

This comment was marked as off-topic.

Comment options

You must be logged in to vote
3 replies
@Afshin9x9-pixel

This comment was marked as off-topic.

@Afshin9x9-pixel

This comment was marked as off-topic.

@Afshin9x9-pixel

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@Samnoorian

This comment was marked as off-topic.

This comment was marked as off-topic.

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies

This comment was marked as off-topic.

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies

This comment was marked as spam.

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@LadyE215
Comment options

@GYGY072H
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage