Closed IvanDeluxe closed 2 years ago
git-auto-commit can't control, if a commit triggers a workflow. As you're using a personal access token, and not the default GITHUB_TOKEN
you've disabled the safe guards given by GitHub.
You have to write your own guard-clause in your workflow to protect you from endless workflow runs. In peusdo-code, this can look something like this:
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Deploy to Firebase Hosting on merge
"on":
push:
branches:
- development
jobs:
build_and_deploy:
+ if: github.triggering_actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
# ...
Links to further documentation:
Thank you :)
For anyone else copy/pasting the above solution (thank you!), note that the syntax is !=
instead of !==
.
@WestonThayer Thanks for the hint. I've updated the comment.
Thank you! One more note for other readers, github.triggering_actor
won't be github-actions[bot]
AKA git-auto-commit-action's default for commit_user_name
, it will be the GitHub user name of whatever account the PAT belongs to.
Version of the Action
v4
Describe the bug I've followed your instructions on how to make this work on a protected branch & as a result it seems that the workflow triggers itself on push.
To Reproduce Assign a personal access token as organization secret & use it with
actions/checkout@v3
.Expected behavior I didn't expect the workflow to trigger itself.
Screenshots https://i.gyazo.com/57c9f863899aa726175447099273331b.png
Used Workflow