generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.53 KB
/
post-release-please.yaml
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
50
51
52
name: post-release-please
on:
pull_request:
types: [reopened, labeled, synchronize]
branches:
- main
jobs:
package:
runs-on: ubuntu-latest
if: "${{ contains(github.event.pull_request.labels.*.name, 'autorelease: pending') }}"
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 2 # amend commit needs to fetch the base branch
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm run package
- name: Compare Expected and Actual Directories
id: compare
run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
echo "diff=true" >> $GITHUB_OUTPUT
fi
- name: add commit
if: ${{ steps.compare.outputs.diff == 'true' }}
run: |
git config user.name ${{ vars.GH_APP_NAME }}[bot]
git config user.email ${{ vars.GH_APP_NAME }}[bot]@users.noreply.github.com
git add ./dist
git commit --amend --no-edit
git push --force origin HEAD