Skip to content

Align with style guide by using click instead of click on in job condition logs #1632

Align with style guide by using click instead of click on in job condition logs

Align with style guide by using click instead of click on in job condition logs #1632

Workflow file for this run

name: Feedback prompt for non-Technical Content team contributors when a PR is closed
on:
pull_request:
types: [closed]
permissions:
contents: read
pull-requests: write
jobs:
comment-on-pr:
# Ask merged main-branch pull request authors for feedback when they are outside
# the docs-content team.
if: github.repository == 'github/docs-internal' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
steps:
- name: Check if PR author is in docs-content team
id: check_team
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
try {
const pr = context.payload.pull_request;
// Numeric IDs survive team renames; slugs do not. GitHub org 9919, docs-content team 2796154.
await github.request('GET /organizations/{org_id}/team/{team_id}/memberships/{username}', {
org_id: 9919,
team_id: 2796154,
username: pr.user.login,
});
} catch(err) {
core.exportVariable('NON_DOCS_HUBBER', 'true');
}
- name: Post changelog instructions comment
if: env.NON_DOCS_HUBBER == 'true'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const pr = context.payload.pull_request;
const prAuthor = pr.user.login;
const assignees = (pr.assignees ?? [])
.filter(a => a.login.toLowerCase() !== "copilot")
.map(a => "@" + a.login)
.join(" ");
let commentBody;
if (assignees) {
commentBody =
"👋 " + assignees +
" - Thanks for your contribution! " +
"If you think something could be improved about the contributor experience, please post in `#docs-contributor-feedback` on Slack.";
} else if (prAuthor.toLowerCase() !== "copilot") {
commentBody =
"👋 @" + prAuthor +
" - Thanks for your contribution! " +
"If you think something could be improved about the contributor experience, please post in `#docs-contributor-feedback` on Slack.";
} else {
commentBody =
"👋 Thanks for your contribution! " +
"If you think something could be improved about the contributor experience, please post in `#docs-contributor-feedback` on Slack.";
}
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
body: commentBody
});