Skip to content

Commit 08bb8e1

Browse files
Repo File Sync: Update to Mu DevOps v15.0.3 (#338)
synced local file(s) with [microsoft/mu_devops](https://github.com/microsoft/mu_devops). 🤖: View the [Repo File Sync Configuration File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml) to see how files are synced. --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#16039182195](https://github.com/microsoft/mu_devops/actions/runs/16039182195) Signed-off-by: Project Mu UEFI Bot <uefibot@microsoft.com> Co-authored-by: mu-automation[bot] <204385837+mu-automation[bot]@users.noreply.github.com>
1 parent 2151ee6 commit 08bb8e1

11 files changed

+60
-56
lines changed

.azurepipelines/MuDevOpsWrapper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ resources:
1919
type: github
2020
endpoint: microsoft
2121
name: microsoft/mu_devops
22-
ref: refs/tags/v15.0.2
22+
ref: refs/tags/v15.0.3
2323

2424
parameters:
2525
- name: do_ci_build

.github/workflows/backport-to-release-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
core.setOutput('pr_number', prNumber);
149149
core.setOutput('backport_needed', 'true');
150150
env:
151-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
151+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
152152

153153
- name: Checkout a Local ${{ steps.backport_info.outputs.target_branch_name }} Branch (Destination Branch)
154154
if: steps.backport_check.outputs.backport_needed == 'true'

.github/workflows/codeql.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
gather_packages:
4444
name: Gather Repo Packages
4545
runs-on: ubuntu-latest
46+
permissions:
47+
contents: read
4648
outputs:
4749
packages: ${{ steps.generate_matrix.outputs.packages }}
4850

@@ -165,38 +167,44 @@ jobs:
165167
- name: Get Cargo Tool Details
166168
id: get_cargo_tool_details
167169
shell: python
170+
env:
171+
AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168172
run: |
169173
import os
170174
import requests
171175
import sys
172176
import time
173177
174-
def get_response_with_retries(url, retries=5, wait_time=10):
178+
def get_response_with_retries(url, headers, retries=5, wait_time=10):
175179
for attempt in range(retries):
176-
response = requests.get(url)
180+
response = requests.get(url, headers=headers)
177181
if response.status_code == 200:
178182
return response
179-
print(f"::warning title=GitHub API Access Error!::Attempt {attempt + 1} failed. Retrying in {wait_time} seconds...")
183+
print(f"::warning title=GitHub API Access Error!::Attempt {attempt + 1} failed ({response.status_code}). Retrying in {wait_time} seconds...")
180184
time.sleep(wait_time)
181185
return response
182186
183187
GITHUB_REPO = "sagiegurari/cargo-make"
184188
api_url = f"https://api.github.com/repos/{GITHUB_REPO}/releases/tags/0.37.24"
189+
headers = {
190+
"Authorization": f"Bearer {os.environ['AUTH_TOKEN']}",
191+
"Accept": "application/vnd.github.v3+json"
192+
}
185193
186-
response = get_response_with_retries(api_url)
194+
response = get_response_with_retries(api_url, headers)
187195
if response.status_code == 200:
188196
build_release_id = response.json()["id"]
189197
else:
190-
print("::error title=GitHub Release Error!::Failed to get cargo-make release ID!")
198+
print(f"::error title=GitHub Release Error!::Failed to get cargo-make release ID! ({response.status_code})")
191199
sys.exit(1)
192200
193201
api_url = f"https://api.github.com/repos/{GITHUB_REPO}/releases/{build_release_id}"
194202
195-
response = get_response_with_retries(api_url)
203+
response = get_response_with_retries(api_url, headers)
196204
if response.status_code == 200:
197205
latest_cargo_make_version = response.json()["tag_name"]
198206
else:
199-
print("::error title=GitHub Release Error!::Failed to get cargo-make!")
207+
print(f"::error title=GitHub Release Error!::Failed to get cargo-make! ({response.status_code})")
200208
sys.exit(1)
201209
202210
cache_key = f'cargo-make-{latest_cargo_make_version}'
@@ -207,12 +215,18 @@ jobs:
207215
print(f'cargo_make_version={latest_cargo_make_version}', file=fh)
208216
209217
210-
- name: Attempt to Load cargo-make From Cache
218+
# Temporarily disable caching cargo-make as it stopped working in some repos recently
219+
# and need to be investigated
220+
# - name: Attempt to Load cargo-make From Cache
221+
# id: cargo_make_cache
222+
# uses: actions/cache@v4
223+
# with:
224+
# path: ${{ steps.get_cargo_tool_details.outputs.cargo_bin_path }}
225+
# key: ${{ steps.get_cargo_tool_details.outputs.cargo_make_cache_key }}
226+
227+
- name: Force cargo-make cache miss
211228
id: cargo_make_cache
212-
uses: actions/cache@v4
213-
with:
214-
path: ${{ steps.get_cargo_tool_details.outputs.cargo_bin_path }}
215-
key: ${{ steps.get_cargo_tool_details.outputs.cargo_make_cache_key }}
229+
run: echo "cache-hit=false" >> $GITHUB_OUTPUT
216230

217231
- name: Download cargo-make
218232
if: steps.cargo_make_cache.outputs.cache-hit != 'true'

.github/workflows/issue-assignment.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,5 @@ on:
1919
jobs:
2020
apply:
2121

22-
permissions:
23-
contents: read
24-
issues: write
25-
26-
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@v15.0.2
22+
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@v15.0.3
23+
secrets: inherit

.github/workflows/label-issues.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
types:
2222
- edited
2323
- opened
24-
pull_request:
24+
pull_request_target:
2525
types:
2626
- edited
2727
- opened
@@ -31,9 +31,5 @@ on:
3131

3232
jobs:
3333
apply:
34-
35-
permissions:
36-
contents: read
37-
pull-requests: write
38-
39-
uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v15.0.2
34+
uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v15.0.3
35+
secrets: inherit

.github/workflows/label-sync.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,5 @@ on:
2525
jobs:
2626
sync:
2727

28-
permissions:
29-
issues: write
30-
31-
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v15.0.2
28+
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v15.0.3
29+
secrets: inherit

.github/workflows/pull-request-formatting-validator.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
name: Validate Pull Request Formatting
1414

1515
on:
16-
pull_request:
16+
pull_request_target:
1717
types:
1818
- edited
1919
- opened
@@ -24,11 +24,15 @@ jobs:
2424
validate_pr:
2525
runs-on: ubuntu-latest
2626

27-
permissions:
28-
contents: read
29-
pull-requests: write
30-
3127
steps:
28+
- name: Generate Token
29+
id: app-token
30+
uses: actions/create-github-app-token@v2
31+
with:
32+
app-id: ${{ vars.MU_ACCESS_APP_ID }}
33+
private-key: ${{ secrets.MU_ACCESS_APP_PRIVATE_KEY }}
34+
owner: ${{ github.repository_owner }}
35+
3236
- run: |
3337
prTitle="$(gh api graphql -F owner=$OWNER -F name=$REPO -F pr_number=$PR_NUMBER -f query='
3438
query($name: String!, $owner: String!, $pr_number: Int!) {
@@ -45,7 +49,7 @@ jobs:
4549
fi
4650
4751
env:
48-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4953
OWNER: ${{ github.repository_owner }}
5054
PR_NUMBER: ${{ github.event.number }}
5155
PR_URL: ${{ github.event.pull_request.html_url }}

.github/workflows/release-draft.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,5 @@ jobs:
3131
draft:
3232
name: Draft Releases
3333

34-
permissions:
35-
contents: write
36-
pull-requests: write
37-
38-
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@v15.0.2
34+
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@v15.0.3
3935
secrets: inherit

.github/workflows/scheduled-maintenance.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,21 @@ jobs:
2525
repo_cleanup:
2626
runs-on: ubuntu-latest
2727

28-
permissions:
29-
pull-requests: write
30-
issues: write
31-
3228
steps:
29+
- name: Generate Token
30+
id: app-token
31+
uses: actions/create-github-app-token@v2
32+
with:
33+
app-id: ${{ vars.MU_ACCESS_APP_ID }}
34+
private-key: ${{ secrets.MU_ACCESS_APP_PRIVATE_KEY }}
35+
owner: ${{ github.repository_owner }}
36+
3337
- name: Get Repository Info
3438
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
3539

3640
- name: Prune Won't Fix Pull Requests
3741
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
3943
REPOSITORY: ${{ env.REPOSITORY_NAME }}
4044
run: |
4145
gh api \
@@ -50,7 +54,7 @@ jobs:
5054
5155
- name: Prune Won't Fix Issues
5256
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
5458
REPOSITORY: ${{ env.REPOSITORY_NAME }}
5559
run: |
5660
gh api \

.github/workflows/stale.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,5 @@ on:
2525
jobs:
2626
check:
2727

28-
permissions:
29-
issues: write
30-
pull-requests: write
31-
32-
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v15.0.2
28+
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v15.0.3
29+
secrets: inherit

0 commit comments

Comments
 (0)