Skip to content

Commit 02611c8

Browse files
authored
Prefix use of composite action with a checkout (#44582)
1 parent 1af1c03 commit 02611c8

26 files changed

Lines changed: 104 additions & 17 deletions

.github/workflows/auto-close-dependencies.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jobs:
6666
console.error(`Failed to lock the pull request. Error: ${error}`)
6767
throw error
6868
}
69-
69+
- name: Check out repo
70+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
7071
- uses: ./.github/actions/slack-alert
7172
with:
7273
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/check-for-spammy-issues.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
types: [opened]
1010

1111
permissions:
12-
contents: none
12+
contents: read
1313

1414
jobs:
1515
spammy-title-check:
@@ -81,6 +81,8 @@ jobs:
8181
console.log(error);
8282
}
8383
84+
- name: Check out repo
85+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
8486
- uses: ./.github/actions/slack-alert
8587
with:
8688
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/close-bad-repo-sync-prs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ jobs:
6161
body: "Please leave this `repo-sync` branch to the robots!\n\nI'm going to close this pull request now, but feel free to open a new issue or ask any questions in [discussions](https://github.com/github/docs/discussions)!"
6262
})
6363
64+
- name: Check out repo
65+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
6466
- uses: ./.github/actions/slack-alert
6567
with:
6668
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/close-on-invalid-label.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
types: [labeled]
1212

1313
permissions:
14+
contents: read
1415
issues: write
1516
pull-requests: write
1617

@@ -32,6 +33,8 @@ jobs:
3233
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3334
run: gh pr close ${{ github.event.pull_request.html_url }}
3435

36+
- name: Check out repo
37+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
3538
- uses: ./.github/actions/slack-alert
3639
with:
3740
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/confirm-internal-staff-work-in-docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- opened
1515

1616
permissions:
17-
contents: none
17+
contents: read
1818

1919
jobs:
2020
check-team-membership:
@@ -80,6 +80,8 @@ jobs:
8080
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
8181
text: <@${{github.actor}}> opened https://github.com/github/docs/issues/${{ github.event.number || github.event.issue.number }} publicly on the github/docs repo instead of a private repo. They have been notified via a new issue in the private repo to confirm this was intentional.
8282

83+
- name: Check out repo
84+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
8385
- uses: ./.github/actions/slack-alert
8486
with:
8587
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/copy-api-issue-to-internal.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- labeled
1111

1212
permissions:
13-
contents: none
13+
contents: read
1414

1515
jobs:
1616
transfer-issue:
@@ -71,6 +71,8 @@ jobs:
7171
NEW_ISSUE: ${{ env.NEW_ISSUE }}
7272
OLD_ISSUE: ${{ github.event.issue.html_url }}
7373

74+
- name: Check out repo
75+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
7476
- uses: ./.github/actions/slack-alert
7577
with:
7678
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/merged-notification.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
permissions:
1313
issues: write
1414
pull-requests: write
15+
contents: read
1516

1617
jobs:
1718
comment:
@@ -27,6 +28,8 @@ jobs:
2728
body: "Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our [help wanted issues](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) :zap:"
2829
})
2930
31+
- name: Check out repo
32+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
3033
- uses: ./.github/actions/slack-alert
3134
with:
3235
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/move-existing-issues-to-the-correct-repo.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
permissions:
11-
contents: none
11+
contents: read
1212

1313
jobs:
1414
transfer_issues:
@@ -24,7 +24,7 @@ jobs:
2424
script: |
2525
const owner = 'github'
2626
const originalRepo = 'docs-internal'
27-
let correctRepo = process.env.TEAM_ENGINEERING_REPO
27+
let correctRepo = process.env.TEAM_ENGINEERING_REPO
2828
2929
const correctRepoObject = await github.rest.repos.get({
3030
owner: owner,
@@ -58,15 +58,15 @@ jobs:
5858
}
5959
}
6060
}`
61-
61+
6262
const variables = {
6363
id: issueNodeId,
6464
repositoryId: correctRepositoryNodeId
6565
}
66-
66+
6767
const graph = await github.graphql(mutation, variables)
6868
console.log('GraphQL mutation result:\n' + JSON.stringify(graph))
69-
69+
7070
// Add the same labels to the new issue
7171
const newIssueNumber = graph.transferIssue.issue.number
7272
await github.rest.issues.addLabels({
@@ -78,6 +78,8 @@ jobs:
7878
}
7979
}
8080
81+
- name: Check out repo
82+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
8183
- uses: ./.github/actions/slack-alert
8284
with:
8385
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/move-help-wanted-issues.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- labeled
1111

1212
permissions:
13-
contents: none
13+
contents: read
1414

1515
jobs:
1616
move_issues:
@@ -27,6 +27,8 @@ jobs:
2727
column: Help wanted
2828
repo-token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
2929

30+
- name: Check out repo
31+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
3032
- uses: ./.github/actions/slack-alert
3133
with:
3234
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

.github/workflows/move-new-issues-to-correct-docs-repo.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- reopened
1313

1414
permissions:
15-
contents: none
15+
contents: read
1616

1717
jobs:
1818
transfer_issue:
@@ -89,6 +89,8 @@ jobs:
8989
labels: context.payload.issue.labels.map(label => label.name),
9090
})
9191
92+
- name: Check out repo
93+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
9294
- uses: ./.github/actions/slack-alert
9395
with:
9496
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}

0 commit comments

Comments
 (0)