Skip to content

Commit 797f293

Browse files
chore: onboard shared workflows (#67)
Co-authored-by: Eric Black <eblack@salesforce.com>
1 parent 2bcd489 commit 797f293

8 files changed

Lines changed: 64 additions & 109 deletions

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@ Learn more about [Conventional Commits](https://www.conventionalcommits.org/).
2323

2424
### Patch Updates (patch semver update)
2525
- [ ] **fix**: Bug fix
26-
- [ ] **perf**: Performance improvement
2726
- [ ] **deps**: Dependency upgrade
2827
- [ ] **revert**: Revert a previous commit
29-
- [ ] **docs**: Documentation change
30-
- [ ] **style**: Styling update
3128
- [ ] **chore**: Change that does not affect production code
3229
- [ ] **refactor**: Refactoring existing code without changing behavior
33-
- [ ] **tests**: Add/update/remove tests
34-
- [ ] **build**: Change to the build system
35-
- [ ] **ci**: Continuous integration workflow update
30+
- [ ] **test**: Add/update/remove tests
3631

3732
## Testing
3833
**Notes**:

.github/dependabot.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ updates:
99
day: "sunday"
1010
timezone: "America/Los_Angeles"
1111
commit-message:
12-
prefix: "chore"
12+
prefix: "deps"
1313
- package-ecosystem: "npm"
1414
directory: "/"
1515
open-pull-requests-limit: 5
@@ -23,11 +23,11 @@ updates:
2323
prefix-development: "chore"
2424
include: "scope"
2525
groups:
26-
dev-deps:
27-
dependency-type: "development"
28-
patch-dependencies:
29-
update-types:
30-
- "patch"
26+
dev-patch-minor-dependencies:
27+
dependency-type: "development"
28+
update-types:
29+
- "patch"
30+
- "minor"
3131
ignore:
3232
- dependency-name: "@oclif/core"
3333
update-types: ["version-update:semver-major"]

.github/release-configs/release-please-config.beta.json

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,6 @@
77
"extra-files": ["README.md"],
88
"bump-minor-pre-major": true,
99
"bump-patch-for-minor-pre-major": true,
10-
"changelog-sections": [
11-
{
12-
"type": "feat",
13-
"section": "Features"
14-
},
15-
{
16-
"type": "fix",
17-
"section": "Bug Fixes"
18-
},
19-
{
20-
"type": "perf",
21-
"section": "Performance Improvements"
22-
},
23-
{
24-
"type": "refactor",
25-
"section": "Code Refactoring"
26-
},
27-
{
28-
"type": "docs",
29-
"section": "Documentation",
30-
"hidden": false
31-
},
32-
{
33-
"type": "test",
34-
"section": "Tests",
35-
"hidden": false
36-
},
37-
{
38-
"type": "build",
39-
"section": "Build System",
40-
"hidden": false
41-
},
42-
{
43-
"type": "ci",
44-
"section": "Continuous Integration",
45-
"hidden": false
46-
},
47-
{
48-
"type": "chore",
49-
"section": "Miscellaneous Chores",
50-
"hidden": false
51-
}
52-
],
5310
"prerelease": true,
5411
"prerelease-type": "beta"
5512
}

.github/release-configs/release-please-config.json

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,7 @@
66
"changelog-path": "CHANGELOG.md",
77
"extra-files": ["README.md"],
88
"bump-minor-pre-major": true,
9-
"bump-patch-for-minor-pre-major": true,
10-
"changelog-sections": [
11-
{
12-
"type": "feat",
13-
"section": "Features"
14-
},
15-
{
16-
"type": "fix",
17-
"section": "Bug Fixes"
18-
},
19-
{
20-
"type": "perf",
21-
"section": "Performance Improvements"
22-
},
23-
{
24-
"type": "refactor",
25-
"section": "Code Refactoring"
26-
},
27-
{
28-
"type": "docs",
29-
"section": "Documentation",
30-
"hidden": false
31-
},
32-
{
33-
"type": "test",
34-
"section": "Tests",
35-
"hidden": false
36-
},
37-
{
38-
"type": "build",
39-
"section": "Build System",
40-
"hidden": false
41-
},
42-
{
43-
"type": "ci",
44-
"section": "Continuous Integration",
45-
"hidden": false
46-
},
47-
{
48-
"type": "chore",
49-
"section": "Miscellaneous Chores",
50-
"hidden": false
51-
}
52-
]
9+
"bump-patch-for-minor-pre-major": true
5310
}
5411
},
5512
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.0-beta.0"
2+
".": "2.0.1-beta.0"
33
}

.github/workflows/release-on-push.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Release on Push
22

33
# Automatically creates GitHub releases after release PRs are merged
4+
# Uses vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID and secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY
45

56
on:
67
push:
@@ -16,13 +17,22 @@ jobs:
1617
contents: write
1718
pull-requests: write
1819
steps:
20+
# owner scopes the token to the org installation so it can access other repos (e.g. private npm-release-workflows)
21+
- name: Generate GitHub App token
22+
id: app-token
23+
uses: actions/create-github-app-token@v2
24+
with:
25+
app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }}
26+
private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }}
27+
owner: ${{ github.repository_owner }}
28+
1929
- uses: actions/checkout@v6
2030

2131
- name: Checkout workflows repository
2232
uses: actions/checkout@v6
2333
with:
2434
repository: heroku/npm-release-workflows
25-
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
35+
token: ${{ steps.app-token.outputs.token }}
2636
path: workflows-repo
2737
ref: main
2838

@@ -31,4 +41,4 @@ jobs:
3141
with:
3242
package-manager: yarn # npm | yarn | pnpm
3343
branch_name: ${{ github.ref_name }}
34-
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
44+
token: ${{ steps.app-token.outputs.token }}

.github/workflows/release.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Release
22

3-
# Public repo workflow using token-based checkout to access private npm-release-workflows
3+
# Public repo workflow using GitHub App token to access private npm-release-workflows
4+
# Uses vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID and secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY
45

56
on:
67
workflow_dispatch:
@@ -15,13 +16,22 @@ jobs:
1516
validate:
1617
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
1718
steps:
19+
# owner scopes the token to the org installation so it can access other repos (e.g. private npm-release-workflows)
20+
- name: Generate GitHub App token
21+
id: app-token
22+
uses: actions/create-github-app-token@v2
23+
with:
24+
app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }}
25+
private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }}
26+
owner: ${{ github.repository_owner }}
27+
1828
- uses: actions/checkout@v6
1929

2030
- name: Checkout workflows repository
2131
uses: actions/checkout@v6
2232
with:
2333
repository: heroku/npm-release-workflows
24-
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
34+
token: ${{ steps.app-token.outputs.token }}
2535
path: workflows-repo
2636
ref: main
2737

@@ -49,13 +59,22 @@ jobs:
4959
no_release_needed: ${{ steps.release-workflow.outputs.no_release_needed }}
5060
pr_already_exists: ${{ steps.release-workflow.outputs.pr_already_exists }}
5161
steps:
62+
# owner scopes the token to the org installation so it can access other repos (e.g. private npm-release-workflows)
63+
- name: Generate GitHub App token
64+
id: app-token
65+
uses: actions/create-github-app-token@v2
66+
with:
67+
app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }}
68+
private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }}
69+
owner: ${{ github.repository_owner }}
70+
5271
- uses: actions/checkout@v6
5372

5473
- name: Checkout workflows repository
5574
uses: actions/checkout@v6
5675
with:
5776
repository: heroku/npm-release-workflows
58-
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
77+
token: ${{ steps.app-token.outputs.token }}
5978
path: workflows-repo
6079
ref: main
6180

@@ -66,7 +85,7 @@ jobs:
6685
package-manager: yarn # npm | yarn | pnpm
6786
branch_name: ${{ github.ref_name }}
6887
dry_run: ${{ inputs.dry_run }}
69-
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
88+
token: ${{ steps.app-token.outputs.token }}
7089

7190
publish:
7291
needs: release-please-pr
@@ -77,21 +96,30 @@ jobs:
7796
pull-requests: write
7897
id-token: write
7998
steps:
99+
# owner scopes the token to the org installation so it can access other repos (e.g. private npm-release-workflows)
100+
- name: Generate GitHub App token
101+
id: app-token
102+
uses: actions/create-github-app-token@v2
103+
with:
104+
app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }}
105+
private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }}
106+
owner: ${{ github.repository_owner }}
107+
80108
- uses: actions/checkout@v6
81109

82110
- name: Checkout workflows repository
83111
uses: actions/checkout@v6
84112
with:
85113
repository: heroku/npm-release-workflows
86-
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
114+
token: ${{ steps.app-token.outputs.token }}
87115
path: workflows-repo
88116
ref: main
89117

90118
- name: Publish to npm
91119
uses: ./workflows-repo/.github/actions/release-publish-public
92120
with:
93121
package-manager: yarn # npm | yarn | pnpm
94-
workflows_token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
122+
workflows_token: ${{ steps.app-token.outputs.token }}
95123
build_command: 'run build'
96124
dry_run: ${{ inputs.dry_run }}
97125
npm_tag: ${{ needs.release-please-pr.outputs.npm_tag }}

.github/workflows/update-release-configs.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Update Release Configs
22

33
# Generates release-please config files from release-channels.yml
4+
# Uses vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID and secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY
45

56
on:
67
workflow_dispatch:
@@ -12,13 +13,20 @@ jobs:
1213
contents: write
1314
pull-requests: write
1415
steps:
16+
- name: Generate GitHub App token
17+
id: app-token
18+
uses: actions/create-github-app-token@v2
19+
with:
20+
app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }}
21+
private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }}
22+
1523
- uses: actions/checkout@v6
1624

1725
- name: Checkout workflows repository
1826
uses: actions/checkout@v6
1927
with:
2028
repository: heroku/npm-release-workflows
21-
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
29+
token: ${{ steps.app-token.outputs.token }}
2230
path: workflows-repo
2331
ref: main
2432

0 commit comments

Comments
 (0)