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