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

Deprecation after 'workflow_run` event added by GitHub Actions #7

Open
potiuk opened this issue Aug 20, 2020 · 2 comments
Open

Deprecation after 'workflow_run` event added by GitHub Actions #7

potiuk opened this issue Aug 20, 2020 · 2 comments

Comments

@potiuk
Copy link

potiuk commented Aug 20, 2020

Hello @n1hility -> after GitHub Actions added support for worfklow_run events (https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/ I decided to write my own action that would support it and make it easy to use for pull requests from forks. The previous workaround with the scheduled run was really not a nice one.

I needed it for the Apache Airflow project - where I am one of the committers and a PMC member, and I have just merged a PR (after extensive testing on my own fork) where I used my action. You can see it used here: https://github.com/apache/airflow/blob/master/.github/workflows/build-images-workflow-run.yml

Here is the action (it has a lot of examples and very comprehensive documentation):

And you can see some of the sequence diagrams of how it actually works in the context of Airflow in this PR with the documentation: https://github.com/PolideaInternal/airflow/blob/future-ci-documentation/CI.rst#ci-sequence-diagrams

I think it would be great to somehow point out the action of mine, as the action of yours is already somehow deprecated when it comes to workflow_run. - or alternatively, if you would like to pull in my changes and make me a contributor if you already have a lot of users for your action and you want to keep on maintaining it, this might be another option.

Happy to discuss :)

@potiuk potiuk changed the title Deprecation after 'worfklow_runs` events added by GitHub Actions Deprecation after 'worfklow_run` event added by GitHub Actions Aug 20, 2020
@potiuk potiuk changed the title Deprecation after 'worfklow_run` event added by GitHub Actions Deprecation after 'workflow_run` event added by GitHub Actions Aug 20, 2020
@potiuk
Copy link
Author

potiuk commented Aug 29, 2020

Hey @n1hility -> I just added some fixes and got PRs to my fork and released v2.0.1 version of it. Would you consider somehow merging the two projects? I am happy to do it I am happy to do it either way.

@potiuk
Copy link
Author

potiuk commented Oct 4, 2020

Hey @n1hility ? I am planning to add some more features to my action. Would love if those two get somehow merged or this one deprecated ?

dongjoon-hyun pushed a commit to apache/spark that referenced this issue Jan 11, 2021
Similar to: #31098 apache/calcite#2318 (solution suggestted by vlsi - apache/pulsar#9154 (comment))

I used the action, which was maintained by potiuk instead of the original author, for two reasons:
- the original action was abandoned and is not supported (Proof: n1hility/cancel-previous-runs#7)
- this action works with forks.  The original action only worked when the contribution was run in the same repository and the action had a token with full accesses.

> If you use forks, you should create a separate "Cancelling" workflow_run triggered workflow. The workflow_run should be responsible for all canceling actions. The examples below show the possible ways the action can be utilized.

### What changes were proposed in this pull request?
This PR aims to reduce the GitHub Action usage by cancelling the previous build.

### Why are the changes needed?
In most case, the last commit is meaningful.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?

Due to the nature of the change, testing of this change is difficult.

> Note: This event will only trigger a workflow run if the workflow file is on the default branch.

https://docs.github.com/en/free-pro-teamlatest/actions/reference/events-that-trigger-workflows#workflow_run

However, you can see on my fork that this action is triggered.
https://github.com/mik-laj/spark/actions?query=workflow%3A%22Cancelling+Duplicates%22

I also asked the author of this action to review this change - potiuk (PMC of Apache Airflow) and I have a positive review.

Closes #31104 from mik-laj/patch-1.

Lead-authored-by: Kamil Breguła <[email protected]>
Co-authored-by: Kamil Breguła <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
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

No branches or pull requests

1 participant