@@ -22,6 +22,9 @@ inputs:
22
22
description : The path that Craft will run inside. Defaults to `.`
23
23
required : true
24
24
default : " ."
25
+ craft_config_from_merge_target :
26
+ description : Use the craft config from the merge target branch. Defaults to the repository's default branch
27
+ default : false
25
28
26
29
runs :
27
30
using : " composite"
63
66
craft_url=$(curl -s https://api.github.com/repos/getsentry/craft/releases/${{ inputs.craft_version }} | jq -r '.assets[].browser_download_url | select(endswith("/craft"))')
64
67
sudo curl -sL -o /usr/local/bin/craft "$craft_url"
65
68
sudo chmod +x /usr/local/bin/craft
69
+ - name : Checkout merge target branch
70
+ if : inputs.craft_config_from_merge_target == 'true' && inputs.merge_target
71
+ shell : bash
72
+ run : |
73
+ git fetch origin ${{ inputs.merge_target }}
74
+ git checkout ${{ inputs.merge_target }}
66
75
- name : Craft Prepare
67
76
id : craft
68
77
shell : bash
73
82
# Ensure we have origin/HEAD set
74
83
git remote set-head origin --auto
75
84
CRAFT_LOG_LEVEL=Debug craft prepare "${{ env.RELEASE_VERSION }}"
85
+ - name : Checkout merge target branch
86
+ # We need to check out the merge target branch again because at the end of `craft prepare`
87
+ # craft checks out the default branch
88
+ if : inputs.craft_config_from_merge_target == 'true' && inputs.merge_target
89
+ shell : bash
90
+ run : |
91
+ git fetch origin ${{ inputs.merge_target }}
92
+ git checkout ${{ inputs.merge_target }}
93
+ - name : Read Craft Targets
94
+ id : craft-targets
95
+ shell : bash
96
+ env :
97
+ CRAFT_LOG_LEVEL : Warn
98
+ run : |
76
99
targets=$(craft targets | jq -r '.[]|" - [ ] \(.)"')
77
100
78
101
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
96
119
else
97
120
subdirectory='/${{ inputs.path }}';
98
121
fi
99
-
122
+
100
123
if [[ -n '${{ inputs.merge_target }}' ]]; then
101
124
merge_target='${{ inputs.merge_target }}';
102
125
else
@@ -115,9 +138,9 @@ runs:
115
138
fi
116
139
117
140
body="Requested by: @$GITHUB_ACTOR
118
-
141
+
119
142
Merge target: $merge_target
120
-
143
+
121
144
Quick links:
122
145
- [View changes](https://github.com/$GITHUB_REPOSITORY/compare/${{ steps.release-git-info.outputs.last }}...${{ steps.release-git-info.outputs.branch }})
123
146
- [View check runs](https://github.com/$GITHUB_REPOSITORY/commit/${{ steps.release-git-info.outputs.sha }}/checks/)
@@ -127,7 +150,7 @@ runs:
127
150
128
151
### Targets
129
152
130
- ${{ steps.craft.outputs.targets }}
153
+ ${{ steps.craft-targets .outputs.targets }}
131
154
132
155
Targets marked with a checkbox have already been executed. Administrators can manually tick a checkbox to force craft to skip it.
133
156
"
0 commit comments