Skip to content

Commit bfe961a

Browse files
authored
Factor out clone step, GH token from new pick request workflow (#1248)
1 parent 272801f commit bfe961a

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/respond-on-new-pick-request.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@ on:
44
issues:
55
types: [labeled]
66

7+
permissions:
8+
issues: write
9+
710
jobs:
811
publish-message:
912
runs-on: ubuntu-latest
1013
steps:
11-
- name: Checkout the repo
12-
uses: actions/checkout@v4
1314
- name: Publish Message
1415
uses: actions/github-script@v7
1516
if: github.event.label.name == 'Type Pick Request'
1617
with:
17-
github-token: ${{ secrets.REACT_NATIVE_BOT_REACT_WG_REACT_NATIVE_RELEASES_TOKEN }}
1818
script: |
19-
const fs = require("fs");
20-
const path = require("path");
21-
const message = fs.readFileSync(path.resolve(process.env.GITHUB_WORKSPACE, '.github/workflows/pick-request-hello-message.md'), 'utf8');
22-
github.rest.issues.createComment({
19+
const { data } = await github.rest.repos.getContent({
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
path: '.github/workflows/templates/pick-request-hello-message.md',
23+
});
24+
const message = Buffer.from(data.content, 'base64').toString('utf8');
25+
await github.rest.issues.createComment({
2326
issue_number: context.issue.number,
2427
owner: context.repo.owner,
2528
repo: context.repo.repo,
2629
body: message
27-
})
30+
});
File renamed without changes.

0 commit comments

Comments
 (0)