Skip to content

Commit edae63f

Browse files
authored
Use pwshBot account to allow PR creation in GitHub Workflow (#733)
* Update update.yml * Update update.yml * Update update.yml * Update update.yml * Update update.yml * Update update.yml * Fix code scanning issues * Update update.yml
1 parent 3b26b6c commit edae63f

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

Diff for: .github/workflows/createReminder.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: 'Create reminder'
22

3+
permissions:
4+
contents: read
5+
36
on:
47
issue_comment:
58
types: [created, edited]

Diff for: .github/workflows/processReminders.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: 'Process reminders'
22

3+
permissions:
4+
contents: read
5+
36
on:
47
schedule:
58
- cron: '*/15 * * * *'

Diff for: .github/workflows/rebase.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
on:
55
issue_comment:
66
types: [created]
7+
8+
permissions:
9+
contents: read
10+
711
name: Automatic Rebase
812
jobs:
913
rebase:

Diff for: .github/workflows/update.yml

+20-24
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT license.
33

4-
name: Update Release Build Parameters
4+
name: Daily Updates
5+
6+
permissions:
7+
contents: read
58

69
on:
710
workflow_dispatch:
8-
push:
9-
paths:
10-
- '.github/workflows/update.yml'
11-
branches:
12-
- master
13-
- add-gh-action
14-
pull_request:
15-
paths:
16-
- '.github/workflows/update.yml'
1711
schedule:
1812
# At 20:20 UTC on every day-of-week from Monday through Friday.
1913
- cron: '0 0/4 * * *'
@@ -27,6 +21,9 @@ jobs:
2721
name: Update Release Build Parameters
2822
timeout-minutes: 15
2923
runs-on: ubuntu-20.04
24+
permissions:
25+
pull-requests: write
26+
contents: write # for peter-evans/create-pull-request to create branch
3027
steps:
3128
- name: Checkout
3229
uses: actions/checkout@v2
@@ -37,23 +34,24 @@ jobs:
3734
- name: Create Pull Request
3835
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
3936
id: cpr
40-
uses: peter-evans/create-pull-request@v3
41-
env:
42-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
37+
uses: peter-evans/create-pull-request@v4
4338
with:
39+
token: "${{ secrets.PR_PAT }}"
4440
commit-message: "Update the release build yaml with the latest versions"
45-
committer: GitHub <noreply@github.com>
46-
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
41+
committer: PwshBot <pwshbot@microsoft.com>
42+
author: PwshBot <pwshbot@microsoft.com>
4743
title: "Update the release build yaml with the latest versions"
48-
assignees: travisez13
49-
reviewers: travisez13
5044
base: master
5145
draft: false
5246
branch: update-release-build
47+
push-to-fork: pwshBot/PowerShell-Docker
5348
update-matrix-json:
5449
name: Update Matrix Json
5550
timeout-minutes: 15
5651
runs-on: ubuntu-20.04
52+
permissions:
53+
pull-requests: write
54+
contents: write # for peter-evans/create-pull-request to create branch
5755
steps:
5856
- name: Checkout
5957
uses: actions/checkout@v2
@@ -70,16 +68,14 @@ jobs:
7068
- name: Create Pull Request
7169
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
7270
id: cpr
73-
uses: peter-evans/create-pull-request@v3
74-
env:
75-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
71+
uses: peter-evans/create-pull-request@v4
7672
with:
73+
token: "${{ secrets.PR_PAT }}"
7774
commit-message: "Update the matrix json"
78-
committer: GitHub <noreply@github.com>
79-
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
75+
committer: PwshBot <pwshbot@microsoft.com>
76+
author: PwshBot <pwshbot@microsoft.com>
8077
title: "Update the matrix json"
81-
assignees: travisez13
82-
reviewers: travisez13
8378
base: master
8479
draft: false
8580
branch: update-matrix-json
81+
push-to-fork: pwshBot/PowerShell-Docker

0 commit comments

Comments
 (0)