|
14 | 14 |
|
15 | 15 | name: 'Pull Request to GitHub'
|
16 | 16 |
|
17 |
| -on: workflow_dispatch |
| 17 | +on: 'workflow_dispatch' |
18 | 18 |
|
19 | 19 | env:
|
20 |
| - PR_BRANCH: 'google-github-actions/update-${{github.sha}}' |
| 20 | + PR_BRANCH: 'google-github-actions/update-${{ github.sha }}' |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: 'read' |
| 24 | + statuses: 'write' |
| 25 | + |
| 26 | +defaults: |
| 27 | + run: |
| 28 | + shell: 'bash' |
21 | 29 |
|
22 | 30 | jobs:
|
23 | 31 | pull-request:
|
24 |
| - runs-on: ubuntu-latest |
| 32 | + runs-on: 'ubuntu-latest' |
25 | 33 | steps:
|
26 | 34 | - name: 'Checkout'
|
27 |
| - uses: actions/checkout@v3 |
| 35 | + uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4 |
28 | 36 | with:
|
29 | 37 | path: ./example-workflows
|
30 | 38 |
|
31 | 39 | - name: 'Setup go'
|
32 |
| - uses: actions/setup-go@v3 |
| 40 | + uses: 'actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5' # ratchet:actions/setup-go@v5 |
33 | 41 | with:
|
34 |
| - go-version: '^1.17.7' |
| 42 | + go-version-file: 'go.mod' |
35 | 43 |
|
36 | 44 | - name: 'Checkout Starter Workflows'
|
37 |
| - uses: actions/checkout@v3 |
| 45 | + uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4 |
38 | 46 | with:
|
39 |
| - repository: actions/starter-workflows |
40 |
| - ref: main |
41 |
| - path: ./starter-workflows |
| 47 | + repository: 'actions/starter-workflows' |
| 48 | + ref: 'main' |
| 49 | + path: './starter-workflows' |
42 | 50 |
|
43 | 51 | - name: 'Create New Branch'
|
44 |
| - working-directory: ./starter-workflows |
45 |
| - run: git checkout -b $PR_BRANCH |
| 52 | + working-directory: './starter-workflows' |
| 53 | + run: |- |
| 54 | + git checkout -b "${PR_BRANCH}" |
46 | 55 |
|
47 | 56 | - name: 'Update Files'
|
48 |
| - working-directory: ./example-workflows |
49 |
| - run: go run scripts/release.go |
50 |
| - |
| 57 | + working-directory: './example-workflows' |
| 58 | + run: |- |
| 59 | + go run ./scripts/release/... |
| 60 | +
|
51 | 61 | - name: 'Git Status'
|
52 |
| - working-directory: ./starter-workflows |
53 |
| - run: git status |
54 |
| - |
55 |
| - # - name: 'Push Branch to Remote' |
56 |
| - # working-directory: ./starter-workflows |
57 |
| - # run: git push origin main |
58 |
| - |
59 |
| - # - name: 'Create Pull Request' |
60 |
| - |
61 |
| - # with: |
62 |
| - # script: | |
63 |
| - # const output = ` |
64 |
| - # ## Update Google GitHub Actions Starter Workflows |
65 |
| - |
66 |
| - # ### **NOTE: This is an automated pull request.** |
67 |
| - |
68 |
| - # This pull request was created by the Google GitHub Actions team. |
69 |
| - |
70 |
| - # Please refer to the https://github.com/google-github-actions/example-workflows for more information. |
71 |
| - # `; |
72 |
| - |
73 |
| - # const response = await github.rest.pulls.create({ |
74 |
| - # owner: `actions`, |
75 |
| - # repo: `starter-workflows`, |
76 |
| - # title: `Update Google GitHub Actions Starter Workflows`, |
77 |
| - # head: `${{env.PR_BRANCH}}`, |
78 |
| - # base: `main`, |
79 |
| - # maintainer_can_modify: true, |
80 |
| - # body: output |
81 |
| - # }); |
82 |
| - # |
83 |
| - # console.log(`Pull Request #: ${response.number}`) |
84 |
| - # console.log(`HTML URL : ${response.html_url}`) |
85 |
| - # |
86 |
| - # console.log(`Response: `) |
87 |
| - # console.log(response) |
| 62 | + working-directory: './starter-workflows' |
| 63 | + run: |- |
| 64 | + git status |
| 65 | +
|
| 66 | +# - name: 'Push Branch to Remote' |
| 67 | +# working-directory: ./starter-workflows |
| 68 | +# run: git push origin main |
| 69 | + |
| 70 | +# - name: 'Create Pull Request' |
| 71 | + |
| 72 | +# with: |
| 73 | +# script: | |
| 74 | +# const output = ` |
| 75 | +# ## Update Google GitHub Actions Starter Workflows |
88 | 76 |
|
| 77 | +# ### **NOTE: This is an automated pull request.** |
| 78 | + |
| 79 | +# This pull request was created by the Google GitHub Actions team. |
| 80 | + |
| 81 | +# Please refer to the https://github.com/google-github-actions/example-workflows for more information. |
| 82 | +# `; |
| 83 | + |
| 84 | +# const response = await github.rest.pulls.create({ |
| 85 | +# owner: `actions`, |
| 86 | +# repo: `starter-workflows`, |
| 87 | +# title: `Update Google GitHub Actions Starter Workflows`, |
| 88 | +# head: `${{env.PR_BRANCH}}`, |
| 89 | +# base: `main`, |
| 90 | +# maintainer_can_modify: true, |
| 91 | +# body: output |
| 92 | +# }); |
| 93 | +# |
| 94 | +# console.log(`Pull Request #: ${response.number}`) |
| 95 | +# console.log(`HTML URL : ${response.html_url}`) |
| 96 | +# |
| 97 | +# console.log(`Response: `) |
| 98 | +# console.log(response) |
0 commit comments