-
Notifications
You must be signed in to change notification settings - Fork 6
126 lines (106 loc) · 4.49 KB
/
dependabot_merge.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: "Dependabot Automerge - Action"
on:
pull_request_target:
workflow_dispatch:
jobs:
worker:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
(github.event_name != 'workflow_dispatch' && github.actor != 'dependabot[bot]')
steps:
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
- name: Checkout PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v2
with:
node-version: "15.x"
# Setup the flutter environment.
- uses: subosito/flutter-action@v1
with:
channel: "stable" # 'dev', 'alpha', default to: 'stable'
# flutter-version: '1.12.x' # you can also specify exact version of flutter
- name: Update Ubuntu
run: sudo apt update && sudo apt upgrade -y
- name: Install dependencies
run: sudo apt install fonttools && sudo snap install yq
- name: Get Flutter packages
run: flutter pub get
- name: Run build script
run: bash ./build.sh
working-directory: ./tool/
- name: Set Version and Changelog
run: bash ./set_version.sh
working-directory: ./tool/
- name: Varify Flutter yaml version
run: flutter pub get
- id: set_var
run: |
content=`cat ./vendor/package.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=packageJson::$content"
- name: Stach changes
run: git add .
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git add --all
git commit -m "🤖 - update to ${{fromJson(steps.set_var.outputs.packageJson).dependencies.simple-icons-font}}"
git push https://$USERNAME:[email protected]/jlnrrg/simple_icons.git $GITHUB_REF
env:
REPO_KEY: ${{ secrets.PAT }}
USERNAME: github-actions
# - name: Commit changes
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: "🤖 - update to ${{fromJson(steps.set_var.outputs.packageJson).dependencies.simple-icons-font}}"
# branch: ${{ github.head_ref }}
# token: ${{ github.PAT }}
# - name: Setup Pub Credentials
# run: |
# mkdir -p ~/.pub-cache
# cat <<EOF > ~/.pub-cache/credentials.json
# {
# "accessToken": "${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}",
# "refreshToken": "${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}",
# "tokenEndpoint": "${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}",
# "scopes": ["openid", "https://www.googleapis.com/auth/userinfo.email"],
# "expiration": ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
# }
# EOF
# - name: Check Publish Warnings
# run: flutter pub publish --dry-run
# - name: Publish Package
# run: flutter pub publish -f
# - name: Commit new changes
# run: |
# git config user.name github-actions
# git config user.email [email protected]
# git commit -am "🤖 - update to ${{fromJson(steps.set_var.outputs.packageJson).dependencies.simple-icons-font}}"
# git push origin master
# - name: automerge
# uses: actions/[email protected]
# with:
# script: |
# github.pullRequests.createReview({
# owner: context.payload.repository.owner.login,
# repo: context.payload.repository.name,
# pull_number: context.payload.pull_request.number,
# event: 'APPROVE'
# })
# github.pullRequests.merge({
# owner: context.payload.repository.owner.login,
# repo: context.payload.repository.name,
# pull_number: context.payload.pull_request.number
# })
# github-token: ${{github.token}}