Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Pilot Lvl 1
Message 1 of 11

Filter on Release.Edited but NOT While Published

Solved! Go to Solution.

Hello All,

 

I have the following workflow file:

https://github.com/ExtendedXmlSerializer/home/blob/master/.github/workflows/update-changelog.yml

 

Everything works great except for when I publish a draft release, the `edited` event seems to fire as well.  Is there a way to only trigger this workflow when the current type is NOT `published`?

 

Thank you for any assistance you can provide. 👍

10 Replies
Highlighted
Solution
GitHub Partner
Message 2 of 11

Re: Filter on Release.Edited but NOT While Published

I tested with the same event trigger configuration as yours, and then tried the following actions:

1. Drafted a new release, edited and published directly, the workflow was not triggered as expected.

2. Drafted a new release, edited and published as a pre-release, the workflow was not triggered as expected.

3. Drafted a new release, edited and save draft, re-edited the draft and re-save the draft, then published draft, the workflow was not triggered as expected.

4. Drafted a new release, edited and save draft, re-edited the draft and published draft, the workflow was not triggered as expected.

5. Opened the published release in action 1, re-edited the published release and then click "Update release", the workflow was triggered as expected.

6. Opened the published pre-release in action 2, re-edited the published pre-release and then click "Update release", the workflow was triggered as expected.

 

According to my above tests, the workflow only can be triggered when the published releases or pre-releases are updated/edited, this looks like is normal without problems.  Note: The release event is not triggered for draft releases.

If you want to know what triggers your workflow run, you can use the below two properties of github context to get more info:

github.event_name -- the name of the event, for example: release.

github.event.action -- the action type of the event, for example: edited.

 

And you aslo can reference the example printing context information to the log file to print the detailed info of github context.

example.png

Highlighted
Pilot Lvl 1
Message 3 of 11

Re: Filter on Release.Edited but NOT While Published

Thank you for your reply @BrightRan!

 

Is there a reason why this information is not printed out by default?  It seems *very* important!

 

FWIW the run in question is here: https://github.com/ExtendedXmlSerializer/home/actions/runs/35826091

 

I am not sure if you are able to see with your own records what caused that, but it would be nice to know what happened if possible.

 

In any case, I will add the output to my workflow, thanks again.  Hopefully, we can see going forward what has caused the workflow to trigger and can further debug from there.

Highlighted
Pilot Lvl 1
Message 4 of 11

Re: Filter on Release.Edited but NOT While Published

Also @BrightRan, when you share YML as part of a solution, can you please share it as text and not an image?  It makes it a bit easier to copy/paste into our solutions. 😁

Highlighted
GitHub Partner
Message 5 of 11

Re: Filter on Release.Edited but NOT While Published

All right, sorry for that.

How are things going now?

Have you tried the suggestions I mentioned above? Are they helpful for you to solve the problem?

Highlighted
Pilot Lvl 1
Message 6 of 11

Re: Filter on Release.Edited but NOT While Published

Ah I won't know until our next release, unfortunately, but have put the YML in here in case anyone else wants to copy/paste it:

 

https://github.com/ExtendedXmlSerializer/home/blob/master/.github/workflows/publish-release-build.ym...

 

I will certainly update here on our next release and let you know of any further issues we run into... thank you for your assistance, @BrightRan ! 👍

Highlighted
GitHub Partner
Message 7 of 11

Re: Filter on Release.Edited but NOT While Published

@Mike-E-angelo ,

Have you tried as my suggestion that using the properties github.event_name and github.event.action of github context to get more info about the event?
github.event_name -- the name of the event, for example: release.
github.event.action -- the action type of the event, for example: edited.

How are things going? Is my suggestion helpful to you?
Any progress, please feel free to tell me.

Highlighted
Pilot Lvl 1
Message 8 of 11

Re: Filter on Release.Edited but NOT While Published

Hey @BrightRan !  As luck would have it, we have not released a new release for some time now.  So, I am not sure. 😆  I will certainly update here and let you know.  You can watch our releases here and know when a new release is available:

https://github.com/ExtendedXmlSerializer/home/releases

 

But I will be sure to let you know if I release and/or any troubles we find in doing so. 👍

Highlighted
Pilot Lvl 1
Message 9 of 11

Re: Filter on Release.Edited but NOT While Published

Alright @BrightRan wanted to give you a heads up we are about to launch another version here next week.  Looking at Tuesday.  We will be able to further proceed then.  Thank you for your patience and again for your assistance!

Highlighted
Pilot Lvl 1
Message 10 of 11

Re: Filter on Release.Edited but NOT While Published

Alright @BrightRan I created a new release and the good news is that it worked!  Looks like the `published` event is now being emitted:

https://github.com/ExtendedXmlSerializer/home/runs/533423690?check_suite_focus=true

 

Unfortunately, I have a new problem that hasn't been there before:

 

https://github.com/ExtendedXmlSerializer/home/runs/533424140?check_suite_focus=true

 

```

Installing package 'Poshstache' Downloaded 0.00 MB out of 0.29 MB. [ ] ::error file=/github/home/.local/share/powershell/Modules/Poshstache/0.1.6/ConvertTo-PoshstacheTemplate.ps1,line=67,col=24::Unable to find type [Stubble.Core.Builders.StubbleBuilder].

```

Do you happen to know anything about this?