forked from toko-bifrost/ms-teams-deploy-card
-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (64 loc) · 2.09 KB
/
automerge-dependabot.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Dependabot auto-merge
on:
pull_request:
types:
- opened
- reopened
permissions:
actions: write
contents: write
pull-requests: write
jobs:
merge:
runs-on: ubuntu-latest
concurrency: dependabot-automerge
if: github.actor == 'dependabot[bot]'
steps:
- name: Fetch dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
id: checkout
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: setup node
id: node-setup
if: steps.checkout.conclusion == 'success'
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Update dependencies
id: update
if: steps.node-setup.conclusion == 'success'
run: |
set -euo pipefail
git config user.email "[email protected]"
git config user.name "Automatic dependency updates"
yarn install
yarn ncc
git add dist
git commit --amend --no-edit
git push --force
- name: Wait for pull request to update
id: wait
if: steps.update.conclusion == 'success'
run: sleep 5
- name: Merge
id: merge
if: steps.wait.conclusion == 'success'
run: gh pr merge '${{ github.event.pull_request.number }}' --squash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Pushes by GitHub actions don't trigger workflows, so we need to trigger the publish workflow manually
- name: Trigger publish
if: steps.merge.conclusion == 'success'
run: |
set -euo pipefail
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
gh workflow run publish.yaml --ref master