Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run github actions only once on PR #246

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

knoxfighter
Copy link
Member

Prevent running the github actions twice, when we create a PR from a branch on this repo.

@knoxfighter
Copy link
Member Author

This has only small potential to work!
A call to 'actions/cancel-action' needs to have actions:write permission, which it hasn't, when it is called from a PR.

It could work, when it is run from the this repo (which would be fine, cause this code will only run from this repo).

Another point: Get the name of the resulting repo (in case of this PR it would be knoxfighter)

@knoxfighter
Copy link
Member Author

It seems like it works, with a custom action i wrote on my user.

Current behaviour will instantly cancel the PR if the base branch is on this repo (hardcoded).

Behavior can also be seen in PR #248 with cancelled build https://github.com/OpenFactorioServerManager/factorio-server-manager/actions/runs/522704849.

@mroote If you're fine with that behaviour, i will move the action also to this org and change it in the workflow.

@mroote
Copy link
Member

mroote commented Jan 31, 2021

Wow that's cool nice one! This action might be useful to other people too if you want to make it more generalized. Looks good to merge for this repo though.

@knoxfighter knoxfighter closed this Mar 9, 2021
@knoxfighter knoxfighter deleted the branch OpenFactorioServerManager:develop March 9, 2021 20:38
@knoxfighter knoxfighter reopened this Mar 9, 2021
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.

None yet

2 participants