levibostian / action-sync-branches

GitHub Action to copy and push commits from one branch to another.
MIT License
0 stars 0 forks source link

Workflow not failing even when a step is failing #32

Open BenjaminMichaelis opened 11 months ago

BenjaminMichaelis commented 11 months ago

On this workflow: https://github.com/IntelliTect/EssentialCSharp/actions/runs/6794843503/job/18471914305

It fails due to not being able to be able to push (shows in the action-sync-branches step). However, the workflow still appears successful. The workflow should show as failed in this case.

levibostian commented 11 months ago

Thanks for bringing this up!

I think I know why this is happening. I created a bug fix branch I would appreciate if you could run to test this out.

- uses: levibostian/action-sync-branches@fail-early

If you find this works, I'll merge the fix.

BenjaminMichaelis commented 11 months ago

Thanks for bringing this up!

I think I know why this is happening. I created a bug fix branch I would appreciate if you could run to test this out.


- uses: levibostian/action-sync-branches@fail-early

If you find this works, I'll merge the fix.

Great! I will try it in a bit!

Also, it seems like maybe the github token isn't actually being used? Is that true? There are permission errors that don't occur with other merge actions I've tested that shouldn't show up if the github token is being used properly.

levibostian commented 11 months ago

Ah, great question.

it seems like maybe the github token isn't actually being used? Is that true?

It is being used because without it, you would get an auth error during git push part of the action.

There are permission errors that don't occur with other merge actions I've tested that shouldn't show up if the github token is being used properly.

It does look like the docs could use an update to demonstrate how to use the built-in github actions token to make setup easier. I updated the fail-early branch to use github token. I hope this makes things easier for you.

Check your repository default settings for the github token.

CleanShot 2023-11-08 at 07 19 26@2x

Perhaps your repository is configured to have read and write access to the github repo by default? If so, then some plugins would indeed not need any extra github token setup to work. But if read-only access is set, then you would need to configure the github token with extra permissions. The readme changes I made to this plugin demonstrates this permissions setup.