Skip to content

Commit 000efaf

Browse files
committed
chore: uses app to bypass branch protections
1 parent 95248c7 commit 000efaf

File tree

1 file changed

+43
-13
lines changed

1 file changed

+43
-13
lines changed

.github/workflows/publish-package.yml

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@ permissions:
1111
contents: write
1212

1313
jobs:
14+
build-and-lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: setup Node
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: "18.15"
26+
cache: "yarn"
27+
28+
- name: Install
29+
run: yarn install --frozen-lockfile --non-interactive
30+
31+
- name: Build
32+
run: yarn build
33+
34+
- name: Lint
35+
run: yarn lint
36+
1437
publish:
1538
if: github.event.pull_request.merged == true && (contains(github.event.pull_request.labels.*.name, 'release-major') || contains(github.event.pull_request.labels.*.name, 'release-minor') || contains(github.event.pull_request.labels.*.name, 'release-patch'))
1639
runs-on: ubuntu-latest
@@ -32,31 +55,38 @@ jobs:
3255
echo "type=$VERSION_TYPE" >> $GITHUB_OUTPUT
3356
echo "Running a $VERSION_TYPE release"
3457
35-
- name: Checkout
36-
uses: actions/checkout@v3
37-
with:
38-
ref: "main"
39-
fetch-depth: 0
40-
token: ${{ secrets.GITHUB_TOKEN }}
41-
4258
- name: Setup Node
4359
uses: actions/setup-node@v3
4460
with:
4561
node-version: "18.15"
4662
cache: "yarn"
4763
registry-url: "https://registry.npmjs.org"
4864

65+
- name: Configure git access
66+
uses: actions/create-github-app-token@v1
67+
id: app-token
68+
with:
69+
app-id: ${{ secrets.JAM_GIT_PUSHER_APP_ID }}
70+
private-key: ${{ secrets.JAM_GIT_PUSHER_PRIVATE_KEY }}
71+
72+
- name: Checkout
73+
uses: actions/checkout@v3
74+
with:
75+
ref: "main"
76+
fetch-depth: 0
77+
token: ${{ steps.app-token.outputs.token }}
78+
79+
- name: Configure git author
80+
run: |
81+
git config user.name github-actions
82+
git config user.email github-actions@github.com
83+
4984
- name: Install dependencies
5085
run: yarn install --frozen-lockfile --non-interactive
5186

5287
- name: Build
5388
run: yarn build
5489

55-
- name: Configure Git
56-
run: |
57-
git config --local user.email "action@github.com"
58-
git config --local user.name "GitHub Action"
59-
6090
- name: Tag release
6191
id: bump-version
6292
env:
@@ -71,7 +101,7 @@ jobs:
71101
git tag v$NEW_VERSION
72102
git push --tags origin main
73103
74-
- name: Create GitHub Release
104+
- name: Create a GitHub Release
75105
uses: actions/create-release@v1
76106
env:
77107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)