File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -55,17 +55,21 @@ jobs:
55
55
run : packer init hcl2-files
56
56
continue-on-error : true
57
57
58
+ - name : Determine Branch name
59
+ id : get-branch-name
60
+ run :
61
+
58
62
- name : Packer Validate
59
63
id : validate
60
- # If the workflow is triggered manually or scheduled, uses the tag, otherwise uses the current branch for building the AMI
61
- run : packer validate -var "optimum_version=${{ github.event.inputs.tag || github.ref }}" -var "region=${{ env.AWS_REGION }}" hcl2-files
64
+ # If the workflow is triggered manually or scheduled, uses the tag, otherwise uses the name of branch that triggered worklfow for building the AMI
65
+ run : packer validate -var "optimum_version=${{ github.event.inputs.tag || github.head_ref || github.ref_name }}" -var "region=${{ env.AWS_REGION }}" hcl2-files
62
66
continue-on-error : true
63
67
64
68
- name : Packer Build
65
69
id : build
66
- # If the workflow is triggered manually or scheduled, uses the tag, otherwise uses the current branch for building the AMI
70
+ # If the workflow is triggered manually or scheduled, uses the tag, otherwise uses the name of branch that triggered worklfow for building the AMI
67
71
run : |
68
- packer build -var "optimum_version=${{ github.event.inputs.tag || github.ref }}" -var "region=${{ env.AWS_REGION }}" hcl2-files
72
+ packer build -var "optimum_version=${{ github.event.inputs.tag || github.head_ref || github.ref_name }}" -var "region=${{ env.AWS_REGION }}" hcl2-files
69
73
70
74
- name : Slack Notification on Failure
71
75
id : slack
You can’t perform that action at this time.
0 commit comments