当我将代码从本地分支推送到远程分支时,Github操作不会触发

时间:2019-12-10 22:44:49

标签: github push github-actions

我创建了一个Github动作,该动作用该语句打印出一些字符串。该操作在我在github.com上进行提交时触发,但在本地进行提交并将其推送到github.com上的远程存储库时不触发。为什么会这样?

这是我的行动...

using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;
using UnityStandardAssets.Utility;
using Random = UnityEngine.Random;

namespace UnityStandardAssets.Characters.FirstPerson
{
    [RequireComponent(typeof (CharacterController))]
    public class FirstPersonController : MonoBehaviour
    {
        [SerializeField] private float m_RunSpeed;

        private CharacterController m_CharacterController;

        // Use this for initialization
        private void Start()
        {
            m_CharacterController = GetComponent<CharacterController>();
        }

        private void FixedUpdate()
        {
            Vector3 move = Vector3.right * m_RunSpeed;

            Physics.SyncTransforms();
            m_CharacterController.Move(move * Time.fixedDeltaTime);
        } 
    }
}

2 个答案:

答案 0 :(得分:1)

尝试简化“启动”触发器。由于您不在乎要推送到哪个分支,因此可以这样表示:

on: [push]

答案 1 :(得分:0)

我遇到了类似的问题。除了Lando1n的建议外,我还建议确保操作文件位于所需的功能分支上。从select *, address <-> unmatchedAddress from AddressSecondary cross join lateral ( select * from AddressPrimary order by address <-> unmatchedAddress limit 1 ) as foo 进行推送时,Github将仅执行feature-branch上操作文件中指定的操作。请参阅我类似的答案here