-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (48 loc) · 1.87 KB
/
secondAction.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Test Primer action to trigger Ci jobs with read only actions
on:
push:
branches:
- main
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- id: get-access-token
uses: camertron/github-app-installation-auth-action@v1
with:
app-id: ${{ vars.APP_ID }}
installation-id: ${{ vars.INSTALLATION_ID }}
client-id: ${{ vars.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout repo
uses: actions/checkout@v3
with:
token: ${{ steps.get-access-token.outputs.access-token }}
- name: Write the next version of primer react to readme for test
id: primer-react-version
uses: actions/github-script@v6
with:
script: |
const fs = require('fs')
const response = await fetch('https://registry.npmjs.org/@primer/react')
const data = await response.json()
const { 'dist-tags' : tags} = data
const latestNextTag = tags.next
fs.writeFileSync('./README.md', `Latest primer react version is ${latestNextTag}`)
return latestNextTag
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_TOKEN: ${{ steps.get-access-token.outputs.access-token }}
# Create a new PR with the release candidate installed
- name: Create PR
uses: peter-evans/create-pull-request@v3
with:
token: ${{ steps.get-access-token.outputs.access-token }}
base: main
branch: 'primer/react-integration-test'
delete-branch: true
commit-message: 'Integration tests for @primer/react ${{ steps.primer-react-version.outputs.result }}'
title: 'Integration tests for @primer/react '
body: |
test action permissions