You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specify bucket-path when github.head_ref is not set
In the workflow we're executing the `thesis/[email protected]`
action. One of its inputs is `bucket-path`, wich is an optional
input and is used to configure bucket path.
If in the workflow step executing the action we don't use the
`bucket-path` property, the action will set its `bucket-path` input to
the default value which is `.`. This is the value that we want to use
when workflow is triggered manually or by merge to main.
Previously we thought that setting the action to use
`bucket-name: ${{ github.head_ref }}` property would do the trick of
using `.` for `workflow_dispatch` and `push` events and using
`head_ref` for `pull_request` events (because we thouth the default
value will be used when `bucket-name: ` (vithout a value) is used in
the action. But this turned out to not be truth. When we use
`bucket-name: ` the behavior is different than when we don't provide the
`bucket-name` property at all. In the first case we don't see the
`bucket-name` property in the runner's log, in the second case we see
the property populated with the default `.` value.
Not having `bucket-name` property in the runner results in wrong
behavior of the action (order of the inputs gets messed up and the
address of bucket gets resolved to gs://<BUCKETNAME>/<BUILDFOLDER>".
As a solution we add a `set-bucket-path` step which creates an output
which vallue is either `.` or `github.head_ref`, depending if the
latter is configured. We then use this output as value of `bucket-path`
parameter of action `thesis/[email protected]`.
Read more about how runner handles empty values here:
actions/runner#924.
0 commit comments