-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate: GitHub Actions v2 YAML workflow setting example with hugo
- Loading branch information
Showing
1 changed file
with
26 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6492b52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why the
if: success()
is necessary?6492b52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the build step finishes with neutral, the deploy step starts. To prevent it, we need
if: success()
6492b52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These days, GitHub Actions v2 seems to ignore a delete event by default. Maybe, we no longer need those if statements (
if: github.event.deleted == false
andif: success()
).I created #12
6492b52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peaceiris Thanks for the answer! When would the build step finish with neutral? When it doesn't execute because of its own
if
condition?6492b52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Steps will stop with neutral status when the
if
condition is false.When we delete a branch or a tag, GitHub Actions detect a delete event. (
github.event.deleted == true
) Thus, we can setif: github.event.deleted == false
to prevent from running a step.