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
- name: Show branches/tags and checkout debian/upstream latest
98
+
working-directory: ./package-repo
91
99
run: |
92
-
cd ./package-repo
93
-
94
100
git branch
95
101
git tag
96
102
git checkout ${{inputs.debian-branch}}
@@ -102,18 +108,16 @@ jobs:
102
108
fi
103
109
104
110
- name: Make sure the upstream tag is not already part of the repo
111
+
working-directory: ./package-repo
105
112
run: |
106
-
cd ./package-repo
107
-
108
113
if (git tag --list | grep "${{inputs.upstream-tag}}"); then
109
114
echo "❌ The supplied upstream tag is wrong as it pertains to this repo already."
110
115
exit 1
111
116
fi
112
117
113
118
- name: Validate the upstream tag promotion state
119
+
working-directory: ./package-repo
114
120
run: |
115
-
cd ./package-repo
116
-
117
121
# Check if the upstream/<normalized_version> tag does not already exists
118
122
if ! git tag --list | grep "upstream/${{env.NORMALIZED_VERSION}}"; then
119
123
echo "✅ The upstream tag '${{inputs.upstream-tag}}' has not been promoted yet. Continuing."
@@ -136,7 +140,6 @@ jobs:
136
140
echo "ℹ️ This is likely a second attempt to promote the same upstream tag, where the first attempt already added the upstream tag in the upstram branch"
if [ -n "${{secrets.UPSTREAM_REPO_READ_PAT}}" ]; then
170
+
echo "ℹ️ Adding upstream remote with token authentication. This is because the upstream repository may be private and require authentication to fetch tags."
echo "ℹ️ Fetching tags from upstream repository using token authentication."
180
+
181
+
# Override the global extraheader set by actions/checkout (GITHUB_TOKEN) which would otherwise
182
+
# take precedence over the credentials embedded in the URL and prevent access to external repos.
183
+
if ! git -c http.https://github.com/.extraheader="" fetch upstream-source "+refs/tags/*:refs/tags/*"; then
184
+
echo "❌ Failed to fetch tags from '${{inputs.upstream-repo}}'."
185
+
186
+
if [ -n "${{secrets.UPSTREAM_REPO_READ_PAT}}" ]; then
187
+
echo "❌ Ensure that the UPSTREAM_REPO_READ_PAT token has the permission on the repository."
188
+
echo "❌ For more information about this token, see the README.md in qcom-build-utils repo."
189
+
else
190
+
echo "❌ Make sure the upstream repository is public or if it is private that the UPSTREAM_REPO_READ_PAT token is set and has the necessary permissions."
191
+
fi
192
+
193
+
exit 1
194
+
fi
168
195
169
196
- name: Ensure the tag exists in the upstream repo
197
+
working-directory: ./package-repo
170
198
run: |
171
-
cd ./package-repo
172
-
173
199
if ! git rev-parse --verify "refs/tags/${{inputs.upstream-tag}}" >/dev/null 2>&1; then
174
200
echo "❌ The specified upstream tag '${{inputs.upstream-tag}}' does not exist in the upstream repository."
175
201
exit 1
176
202
fi
177
203
178
204
- name: Pre-populate the upstream/latest branch if first promotion
205
+
working-directory: ./package-repo
179
206
run: |
180
-
cd ./package-repo
181
207
182
208
# If the upstream/latest branch does not exist yet, create it and give it
183
209
# the history of upstream directly, instead of creating an --allow-empty commit
0 commit comments