Skip to content

Commit 1e0ddcb

Browse files
authored
Add support for working with tag pushes
Change-type: minor
1 parent 124ea0f commit 1e0ddcb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/action.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ export async function run(
9090
let buildOptions = null;
9191

9292
// If we are pushing directly to the target branch then just build a release without draft flag
93-
if (context.eventName === 'push' && context.ref === `refs/heads/${target}`) {
93+
if (context.eventName === 'push' && (context.ref === `refs/heads/${target}` || context.ref_type === 'tag')) {
9494
// Make a final release because context is master workflow
9595
buildOptions = {
9696
draft: false,
97-
tags: { sha: context.sha },
97+
tags: {
98+
sha: context.sha,
99+
...(context.ref_type === 'tag' && { tag: context.ref_name }),
100+
},
98101
};
99102
} else if (context.eventName !== 'pull_request') {
100103
// Make sure the only events now are Pull Requests

0 commit comments

Comments
 (0)